equip kinda wip
This commit is contained in:
+86
-2
@@ -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<Skill> for Item {
|
||||
@@ -403,9 +485,10 @@ pub fn get_combos() -> Vec<Combo> {
|
||||
|
||||
#[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::<Vec<ItemInfo>>();
|
||||
|
||||
|
||||
+8
-8
@@ -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");
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user