add delay info to client

This commit is contained in:
Mashy 2020-01-09 15:34:15 +10:00
parent 45b38a73e5
commit cb14b1c50f
3 changed files with 7 additions and 2 deletions

View File

@ -96,7 +96,7 @@ function genItemInfo(item, itemInfo, player) {
itemSourceInfo = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]()); itemSourceInfo = reactStringReplace(itemSourceInfo, itemRegEx, match => shapes[match]());
} }
const cooldown = isSkill && fullInfo.cooldown ? <div>{fullInfo.cooldown} Turn delay</div> : null; const cooldown = isSkill && fullInfo.cooldown ? <div>{fullInfo.delay} turn delay, {fullInfo.cooldown} turn cooldown</div> : null;
const speed = isSkill const speed = isSkill
? <div> Speed {shapes.SpeedStat()} multiplier {fullInfo.speed * 4}% </div> ? <div> Speed {shapes.SpeedStat()} multiplier {fullInfo.speed * 4}% </div>

View File

@ -1362,6 +1362,7 @@ pub struct ItemInfo {
pub values: Option<SpecValues>, pub values: Option<SpecValues>,
pub skill: bool, pub skill: bool,
pub speed: Option<usize>, pub speed: Option<usize>,
pub delay: Cooldown,
pub cooldown: Cooldown, pub cooldown: Cooldown,
pub description: String, pub description: String,
} }
@ -1406,6 +1407,10 @@ pub fn item_info() -> ItemInfoCtr {
Some(s) => s.base_cd(), Some(s) => s.base_cd(),
None => None None => None
}, },
delay: match v.into_skill() {
Some(s) => s.delay(),
None => None
},
}) })
.collect::<Vec<ItemInfo>>(); .collect::<Vec<ItemInfo>>();

View File

@ -571,7 +571,7 @@ impl Skill {
Skill::Counter| Skill::Counter|
Skill::CounterPlus | Skill::CounterPlus |
Skill::CounterPlusPlus => None, // avoid all damage Skill::CounterPlusPlus => None,
Skill::Restrict | Skill::Restrict |
Skill::RestrictPlus | Skill::RestrictPlus |