unequipClick(e)}>
Specs
{specs}
diff --git a/client/src/components/nav.jsx b/client/src/components/nav.jsx
index f36c6c3e..c2f24989 100644
--- a/client/src/components/nav.jsx
+++ b/client/src/components/nav.jsx
@@ -80,7 +80,8 @@ function Nav(args) {
Team
{teamElements}
Instances
-
+
+
{joined}
Hax
diff --git a/client/src/components/team.jsx b/client/src/components/team.jsx
index e88572b4..0af80d00 100644
--- a/client/src/components/team.jsx
+++ b/client/src/components/team.jsx
@@ -113,7 +113,7 @@ function Team(args) {
disabled={team.some(c => !c)}
className="instance-btn instance-ui-btn right"
onClick={() => navToList()}>
- Join an Instance
+ Join Instance
);
diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx
index 3b01595f..9a77cf61 100644
--- a/client/src/components/vbox.component.jsx
+++ b/client/src/components/vbox.component.jsx
@@ -89,7 +89,7 @@ function Vbox(args) {
function freeClick() {
if (c) {
setActiveCryp(null);
- return setInfo('item', c);
+ return setInfo(c);
}
return false;
}
@@ -129,7 +129,7 @@ function Vbox(args) {
const insert = combiner.findIndex(j => j === null);
if (insert === -1) return combinerChange([i, null, null]);
combiner[insert] = i;
- setInfo('item', value);
+ setInfo(value);
setActiveCryp(null);
return combinerChange(combiner);
}
diff --git a/client/src/components/vbox.container.jsx b/client/src/components/vbox.container.jsx
index c61fbfe4..1bb628cd 100644
--- a/client/src/components/vbox.container.jsx
+++ b/client/src/components/vbox.container.jsx
@@ -68,8 +68,8 @@ const addState = connect(
return dispatch(actions.setReclaiming(v));
}
- function setInfo(type, info) {
- return dispatch(actions.setInfo([type, info]));
+ function setInfo(item) {
+ return dispatch(actions.setInfo(item));
}
function setActiveCryp(v) {
@@ -81,7 +81,7 @@ const addState = connect(
}
function showTeam() {
- dispatch(actions.setInfo([null, null]));
+ dispatch(actions.setInfo(null));
dispatch(actions.setVboxHidden(true));
return true;
}
diff --git a/client/src/events.jsx b/client/src/events.jsx
index 98260585..2f2eb5fc 100644
--- a/client/src/events.jsx
+++ b/client/src/events.jsx
@@ -116,8 +116,9 @@ function registerEvents(store) {
store.dispatch(actions.setActiveItem(v));
}
- function clearInfo(info) {
- store.dispatch(actions.setInfo([]));
+ function clearInfo() {
+ store.dispatch(actions.setInfo(null));
+ store.dispatch(actions.setActiveCryp(null));
console.log('event clear item');
}
diff --git a/client/src/keyboard.jsx b/client/src/keyboard.jsx
index 647b4db0..43aa04e1 100644
--- a/client/src/keyboard.jsx
+++ b/client/src/keyboard.jsx
@@ -8,7 +8,9 @@ function setupKeys(store) {
key('esc', () => store.dispatch(actions.setReclaiming(false)));
key('esc', () => store.dispatch(actions.setActiveSkill(null)));
key('esc', () => store.dispatch(actions.setActiveCryp(null)));
- key('esc', () => store.dispatch(actions.setInfo([null, null])));
+ key('esc', () => store.dispatch(actions.setInfo(null)));
+ key('esc', () => store.dispatch(actions.setItemEquip(null)));
+ key('esc', () => store.dispatch(actions.setItemUnequip(null)));
key('esc', () => store.dispatch(actions.setVboxHighlight([])));
}
diff --git a/client/src/reducers.jsx b/client/src/reducers.jsx
index 10097444..7e3e0bfd 100644
--- a/client/src/reducers.jsx
+++ b/client/src/reducers.jsx
@@ -1,5 +1,3 @@
-const actions = require('./actions');
-
function createReducer(defaultState, actionType) {
return function reducer(state = defaultState, action) {
switch (action.type) {
@@ -13,26 +11,28 @@ function createReducer(defaultState, actionType) {
/* eslint-disable key-spacing */
module.exports = {
- account: createReducer(null, actions.SET_ACCOUNT),
- activeCryp: createReducer(null, actions.SET_ACTIVE_CRYP),
- activeSkill: createReducer(null, actions.SET_ACTIVE_SKILL),
- activeItem: createReducer(null, actions.SET_ACTIVE_VAR),
- combiner: createReducer([null, null, null], actions.SET_COMBINER),
- cryps: createReducer([], actions.SET_CRYPS),
- game: createReducer(null, actions.SET_GAME),
- info: createReducer([null, null], actions.SET_INFO),
- instance: createReducer(null, actions.SET_INSTANCE),
- instances: createReducer([], actions.SET_INSTANCES),
- skip: createReducer(false, actions.SET_SKIP),
- nav: createReducer(null, actions.SET_NAV),
- ping: createReducer(null, actions.SET_PING),
- player: createReducer(null, actions.SET_PLAYER),
- reclaiming: createReducer(false, actions.SET_RECLAIMING),
- resolution: createReducer(null, actions.SET_RESOLUTION),
- team: createReducer([null, null, null], actions.SET_SELECTED_CRYPS),
- showLog: createReducer(false, actions.SET_SHOW_LOG),
- vboxHidden: createReducer(false, actions.SET_VBOX_HIDDEN),
- vboxHighlight: createReducer([], actions.SET_VBOX_HIGHLIGHT),
- itemInfo: createReducer({ combos: [], items: [] }, actions.SET_VBOX_INFO),
- ws: createReducer(null, actions.SET_WS),
+ account: createReducer(null, 'SET_ACCOUNT'),
+ activeCryp: createReducer(null, 'SET_ACTIVE_CRYP'),
+ activeSkill: createReducer(null, 'SET_ACTIVE_SKILL'),
+ activeItem: createReducer(null, 'SET_ACTIVE_VAR'),
+ combiner: createReducer([null, null, null], 'SET_COMBINER'),
+ cryps: createReducer([], 'SET_CRYPS'),
+ game: createReducer(null, 'SET_GAME'),
+ info: createReducer(null, 'SET_INFO'),
+ itemEquip: createReducer(null, 'SET_ITEM_EQUIP'),
+ itemUnequip: createReducer(null, 'SET_ITEM_UNEQUIP'),
+ instance: createReducer(null, 'SET_INSTANCE'),
+ instances: createReducer([], 'SET_INSTANCES'),
+ skip: createReducer(false, 'SET_SKIP'),
+ nav: createReducer(null, 'SET_NAV'),
+ ping: createReducer(null, 'SET_PING'),
+ player: createReducer(null, 'SET_PLAYER'),
+ reclaiming: createReducer(false, 'SET_RECLAIMING'),
+ resolution: createReducer(null, 'SET_RESOLUTION'),
+ team: createReducer([null, null, null], 'SET_SELECTED_CRYPS'),
+ showLog: createReducer(false, 'SET_SHOW_LOG'),
+ vboxHidden: createReducer(false, 'SET_VBOX_HIDDEN'),
+ vboxHighlight: createReducer([], 'SET_VBOX_HIGHLIGHT'),
+ itemInfo: createReducer({ combos: [], items: [] }, 'SET_ITEM_INFO'),
+ ws: createReducer(null, 'SET_WS'),
};
diff --git a/client/src/socket.jsx b/client/src/socket.jsx
index 793b3d0f..48b1917f 100644
--- a/client/src/socket.jsx
+++ b/client/src/socket.jsx
@@ -177,7 +177,6 @@ function createSocket(events) {
function accountInstanceList(res) {
const [struct, playerList] = res;
- sendItemInfo();
events.setInstanceList(playerList);
}
@@ -309,6 +308,7 @@ function createSocket(events) {
events.setAccount(account);
sendAccountInstances();
sendAccountCryps();
+ sendItemInfo();
}
sendPing();
diff --git a/server/src/item.rs b/server/src/item.rs
index 830f5f9f..3e57e659 100644
--- a/server/src/item.rs
+++ b/server/src/item.rs
@@ -242,6 +242,88 @@ impl Item {
_ => None,
}
}
+
+ pub fn into_description(&self) -> String {
+ match self {
+ // colours
+ Item::Blue => format!("Combine with skills and specs to create upgraded items. \n Deterrents and destruction."),
+ Item::Green => format!("Combine with skills and specs to create upgraded items.\n Protection and trickery."),
+ Item::Red => format!("Combine with skills and specs to create upgraded items. \n Speed and chaos."),
+
+ // base skills
+ Item::Attack => format!("Deal {:?}% RedDamage", self.into_skill().unwrap().multiplier()),
+ Item::Block => format!("description"),
+ Item::Stun => format!("description"),
+ Item::Buff => format!("description"),
+ Item::Debuff => format!("description"),
+
+ // specs
+ // Base
+ Item::Damage => format!("description"),
+ Item::Life => format!("description"),
+ Item::Speed => format!("description"),
+
+ // Lifes Upgrades
+ Item::GreenLifeI => format!("description"),
+ Item::RedLifeI => format!("description"),
+ Item::BlueLifeI => format!("description"),
+ Item::GRLI => format!("description"),
+ Item::GBLI => format!("description"),
+ Item::RBLI => format!("description"),
+
+ // Damage Upgrades
+ Item::RedDamageI => format!("description"),
+ Item::BlueDamageI => format!("description"),
+ Item::GreenDamageI => format!("description"),
+ Item::GRDI => format!("description"),
+ Item::GBDI => format!("description"),
+ Item::RBDI => format!("description"),
+
+ // Speed Upgrades
+ Item::RedSpeedI => format!("description"),
+ Item::BlueSpeedI => format!("description"),
+ Item::GreenSpeedI => format!("description"),
+ Item::GRSpeedI => format!("description"),
+ Item::GBSpeedI => format!("description"),
+ Item::RBSpeedI => format!("description"),
+
+ Item::Amplify => format!("description"),
+ Item::Banish => format!("description"),
+ Item::Blast => format!("description"),
+ Item::Chaos => format!("description"),
+ Item::Clutch => format!("description"),
+ Item::Corrupt => format!("description"),
+ Item::Curse => format!("description"),
+ Item::Decay => format!("description"),
+ Item::Hostility => format!("description"),
+ Item::Haste => format!("description"),
+ Item::Heal => format!("description"),
+ Item::Hex => format!("description"),
+ Item::Impurity => format!("description"),
+ Item::Invert => format!("description"),
+ Item::Parry => format!("description"),
+ Item::Purge => format!("description"),
+ Item::Purify => format!("description"),
+ Item::Reflect => format!("description"),
+ Item::Recharge => format!("description"),
+ Item::Ruin => format!("description"),
+ Item::Scatter => format!("description"),
+ Item::Silence => format!("description"),
+ Item::Slay => format!("description"),
+ Item::Sleep => format!("description"),
+ Item::Snare => format!("description"),
+ Item::Strangle => format!("description"),
+ Item::Strike => format!("description"),
+ Item::StrikeII => format!("description"),
+ Item::StrikeIII => format!("description"),
+ Item::Siphon => format!("description"),
+ Item::Taunt => format!("description"),
+ Item::Throw => format!("description"),
+ Item::Triage => format!("description"),
+
+ _ => format!("..."),
+ }
+ }
}
impl From
for Item {
@@ -403,9 +485,10 @@ pub fn get_combos() -> Vec {
#[derive(Debug,Clone,Serialize,Deserialize)]
pub struct ItemInfo {
- pub v: Item,
+ pub item: Item,
pub spec: bool,
pub skill: bool,
+ pub description: String,
}
@@ -431,9 +514,10 @@ pub fn item_info() -> ItemInfoCtr {
let items = items
.into_iter()
.map(|v| ItemInfo {
- v,
+ item: v,
spec: v.into_spec().is_some(),
skill: v.into_skill().is_some(),
+ description: v.into_description(),
})
.collect::>();
diff --git a/server/src/net.rs b/server/src/net.rs
index 5aa0221f..e55915f9 100644
--- a/server/src/net.rs
+++ b/server/src/net.rs
@@ -76,14 +76,14 @@ fn print_panic_payload(ctx: &str, payload: &(Any + Send + 'static)) {
}
pub fn start() {
- panic::set_hook(Box::new(|panic_info| {
- print_panic_payload("set_hook", panic_info.payload());
- if let Some(location) = panic_info.location() {
- info!("LOCATION: {}:{}", location.file(), location.line());
- } else {
- info!("NO LOCATION INFORMATION");
- }
- }));
+ // panic::set_hook(Box::new(|panic_info| {
+ // print_panic_payload("set_hook", panic_info.payload());
+ // if let Some(location) = panic_info.location() {
+ // info!("LOCATION: {}:{}", location.file(), location.line());
+ // } else {
+ // info!("NO LOCATION INFORMATION");
+ // }
+ // }));
let database_url = env::var("DATABASE_URL")
.expect("DATABASE_URL must be set");
diff --git a/server/src/player.rs b/server/src/player.rs
index 11a753fd..50addc8d 100644
--- a/server/src/player.rs
+++ b/server/src/player.rs
@@ -189,6 +189,10 @@ impl Player {
}
pub fn vbox_apply(&mut self, index: usize, cryp_id: Uuid) -> Result<&mut Player, Error> {
+ if self.vbox.bound.get(index).is_none() {
+ return Err(format_err!("no item at index {:?}", index));
+ }
+
let item = self.vbox.bound.remove(index);
match item.effect() {
diff --git a/server/src/skill.rs b/server/src/skill.rs
index 45756bcd..3839df43 100644
--- a/server/src/skill.rs
+++ b/server/src/skill.rs
@@ -499,6 +499,8 @@ impl Effect {
Effect::Ruin => Category::Debuff,
Effect::Curse => Category::Debuff,
Effect::Banish => Category::Debuff, // todo randomise
+ // Effect::Banish => rng.gen_bool(0.5),
+
Effect::Slow => Category::Debuff,
Effect::Haste => Category::Buff,
Effect::Hatred => Category::Buff,