stam -> hp

This commit is contained in:
ntr 2019-03-14 18:57:44 +11:00
parent 9d02499c5a
commit 788c68c015
11 changed files with 61 additions and 80 deletions

View File

@ -28,7 +28,7 @@ class StatBar extends Phaser.GameObjects.Graphics {
if (type === 'HP') {
this.val = this.crypObj.cryp.hp.value;
this.max = this.crypObj.cryp.stamina.value;
this.max = this.crypObj.cryp.hp.value;
this.margin = 0;
} else if (type === 'Red Shield') {
this.val = this.crypObj.cryp.red_shield.value;

View File

@ -67,7 +67,7 @@ class StatSheet extends Phaser.Scene {
};
const CRYP_STATS = [
cryp.stamina,
cryp.hp,
cryp.red_shield,
cryp.blue_shield,
cryp.evasion,

View File

@ -19,7 +19,7 @@ This homepage shows your cryps, joinable online games, PVE options and your item
If you have no cryps yet, press SPAWN and give your cryp a name to create one.
Once you have made a cryp, click on them to visit their stat page and teach them some SKILLS.
The stat page also has descriptions of each skill and their effects.
cryps have 3 basic stats: stamina, red damage and magic damage.
cryps have 3 basic stats: hp, red damage and magic damage.
Toggle whether a cryp is selected for your team by clicking the coloured stripes next to the cryp or press 1,2,3.
Once you have a team ready press the New PVE Game button to start playing.
`;

View File

@ -3,7 +3,7 @@
### Defenses ###
Rare `Increased Stamina`
Rare `Increased Hp`
Common `Increased Evasion rating`
Common `Increased Blue Shield rating`

View File

@ -76,7 +76,7 @@ Non-Violence
Enhancement & Preservation
--------------------------
the philosophy of nonviolence teaches that the sanctity of life is above all else
the philosophy of nonviolence teaches that the sanctity of hp is above all else
its adherants are defensive and gracious, seeking to minimise the damage done by others and doing no direct harm themselves.
they seek to prevent damage in any way possible
@ -98,8 +98,8 @@ specialise in magical damage dealing
* damage amplification
* nukes
* life leach
* life exchange
* hp leach
* hp exchange
* poison
* aoe

View File

@ -39,7 +39,7 @@ In your team Cryp #1 has `Strike`, Cryp #2 has `Slay` and `Heal`, Cryp #3 has `S
- Cryp #2 Unequip Attack
- Combine 2 Green + 'Attack' -> Heal
- Cryp #3 Unequip Stun
- Combine 2 Blue + 'Stun' -> Ruin
@ -74,7 +74,7 @@ In your team Cryp #1 has `Strike`, Cryp #2 has `Slay` and `Heal`, Cryp #3 has `S
- Combine 'Strike' + 2 x Red Damage spec -> 'Increased Strike Damage spec'
### Note 'Increased Strike Damage spec' requires 8R on the cryp
Cryp #1 Equip Increased Strike Damage spec -> Strike, Stun, Strangle, Empower + Increased Strike Damage Spec (14R)
Cryp #2 -> 'No change' -> Heal
Cryp #3 -> 'No change' -> Attack + Ruin + 2 x Basic Damage Spec
@ -85,17 +85,10 @@ In your team Cryp #1 has `Strike`, Cryp #2 has `Slay` and `Heal`, Cryp #3 has `S
### Generic Specs
(Base white skills not upgraded count as have 1 gem basic ?)
# Basic Damage
`Base` -> 10% inc basic damage
`Team Bonus` -> 3 basic gems -> +10% // 6 basic gems -> +15% // 12 basic gems -> +25%
Maximum 60% inc basic damage
# Basic % Life
`Base` -> 5% inc life
# Basic % Hp
`Base` -> 5% inc hp
`Team Bonus` -> 3 basic gems -> +5% // 6 basic gems -> +10% // 12 basic gems -> +15%
Maximum 35% inc life
Maximum 35% inc hp
# Basic Speed
`Base` -> 5% inc speed
@ -110,15 +103,15 @@ Maximum 50% inc speed
Generate by combining `Generic Spec (Basic Damage)` with respective RGB
# Red Damage (Dmg + RR)
# Red Damage (Dmg + RR)
Add 2 `red gems`
`Base` -> 10% inc red dmg
`Base` -> 10% inc red dmg
`Team Bonus` 5 red gems -> +10% // 10 red gems -> +15% // 20 red gems -> +25%
Maximum +60% red damage
# Blue Damage (Dmg + BB) #
Add 2 `blue gems`
`Base` -> 10% inc blue dmg
`Base` -> 10% inc blue dmg
`Team Bonus` 5 blue gems -> +10% // 10 blue gems -> +15% // 20 blue gems -> +25%
Maximum +60% blue damage
@ -146,9 +139,9 @@ Add 1 blue and 1 green gem
`Team Bonus` (2B + 2G gems) -> +5% + 5% // (5B + 5G gems) -> +10% + 10% % // (10B + 10G) gems -> +15% + 15%
Maximum +35% inc blue damage and 35% inc healing
### Increased Life Combos ###
### Increased Hp Combos ###
Generate by combining `Generic Spec (Basic Life)` with respective RGB
Generate by combining `Generic Spec (Basic Hp)` with respective RGB
# Increased % Red Shield (Basic %HP + 2R)
Add 2 `red gems`
@ -156,11 +149,11 @@ Add 2 `red gems`
`Team Bonus` 5 red gems -> +10% // 10 red gems -> +15% // 20 red gems -> +20%
Maximum +55% inc red shield
# Increased % Red Shield and Life (Basic %HP + 1R1G)
# Increased % Red Shield and Hp (Basic %HP + 1R1G)
Add 1 red 1 green gem
`Base` -> 5% inc red shield and 5% inc life
`Base` -> 5% inc red shield and 5% inc hp
`Team Bonus` (2R + 2G gems) -> +5% + 5% // (5R + 5G gems) -> +10% + 10% % // (10R + 10G) gems -> +15% + 15%
Maximum +35% inc red shield and 35% inc life
Maximum +35% inc red shield and 35% inc hp
# Increased % Blue Shield (Basic %HP + 2B)
Add 2 `blue gems`
@ -168,13 +161,13 @@ Add 2 `blue gems`
`Team Bonus` 5 blue gems -> +10% // 10 blue gems -> +15% // 20 blue gems -> +20%
Maximum +55% inc blue shield
# Increased % Blue Shield and Life (Basic %HP + 1B1G)
# Increased % Blue Shield and Hp (Basic %HP + 1B1G)
Add `1 blue and 1 green gems`
`Base` -> 5% inc red shield and 5% inc life
`Base` -> 5% inc red shield and 5% inc hp
`Team Bonus` (2B + 2G gems) -> +5% + 5% // (5B + 5G gems) -> +10% + 10% % // (10B + 10G) gems -> +15% + 15%
Maximum +35% inc blue shield and 35% inc life
Maximum +35% inc blue shield and 35% inc hp
# Increased % Life (Basic %HP + 2G)
# Increased % Hp (Basic %HP + 2G)
Add `2 green gems`
`Base` -> 10% inc hp
`Team Bonus` 5 green gems -> +10% // 10 green gems -> +15% // 20 green gems -> +20%
@ -182,7 +175,7 @@ Maximum +55% inc hp
# Increased % Blue and Red Shield (Basic %HP + 1B1R)
Add `1 blue and 1 red gem`
`Base` -> 5% inc red shield and 5% inc life
`Base` -> 5% inc red shield and 5% inc hp
`Team Bonus` (2B + 2R gems) -> +5% + 5% // (5B + 5R gems) -> +10% + 10% % // (10B + 10R) gems -> +15% + 15%
Maximum +35% inc blue shield and 35% inc red shield

View File

@ -44,7 +44,6 @@ pub enum Stat {
Int,
Hp,
Speed,
Stamina,
RedDamage,
RedDamageTaken,
BlueDamage,
@ -60,6 +59,7 @@ pub enum Stat {
pub struct CrypStat {
base: u64,
value: u64,
max: u64,
pub stat: Stat,
}
@ -80,6 +80,7 @@ impl CrypStat {
// but still needs access to the base amount
let value = specs.iter().fold(self.base, |acc, s| s.apply(acc, self.base));
self.value = value;
self.max = value;
self
}
@ -120,7 +121,6 @@ pub struct Cryp {
pub blue_shield: CrypStat,
pub blue_damage: CrypStat,
pub speed: CrypStat,
pub stamina: CrypStat,
pub hp: CrypStat,
pub evasion: CrypStat,
pub xp: u64,
@ -143,14 +143,13 @@ impl Cryp {
return Cryp {
id,
account: id,
red_damage: CrypStat { base: 0, value: 0, stat: Stat::RedDamage },
red_shield: CrypStat { base: 0, value: 0, stat: Stat::RedShield },
blue_damage: CrypStat { base: 0, value: 0, stat: Stat::BlueDamage },
blue_shield: CrypStat { base: 0, value: 0, stat: Stat::BlueShield },
speed: CrypStat { base: 0, value: 0, stat: Stat::Speed },
stamina: CrypStat { base: 0, value: 0, stat: Stat::Stamina },
hp: CrypStat { base: 0, value: 0, stat: Stat::Hp },
evasion: CrypStat { base: 0, value: 0, stat: Stat::Evasion },
red_damage: CrypStat { base: 0, value: 0, max: 0, stat: Stat::RedDamage },
red_shield: CrypStat { base: 0, value: 0, max: 0, stat: Stat::RedShield },
blue_damage: CrypStat { base: 0, value: 0, max: 0, stat: Stat::BlueDamage },
blue_shield: CrypStat { base: 0, value: 0, max: 0, stat: Stat::BlueShield },
speed: CrypStat { base: 0, value: 0, max: 0, stat: Stat::Speed },
hp: CrypStat { base: 0, value: 0, max: 0, stat: Stat::Hp },
evasion: CrypStat { base: 0, value: 0, max: 0, stat: Stat::Evasion },
lvl: 0,
xp: 0,
skills: vec![],
@ -225,10 +224,7 @@ impl Cryp {
Stat::RedDamage => self.red_damage.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::BlueDamage => self.blue_damage.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Speed => self.speed.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Stamina => {
self.stamina.set(rng.gen_range(stam_min, stam_max), &self.specs);
self.hp.set(self.stamina.base, &self.specs)
},
Stat::Hp => self.hp.set(rng.gen_range(stam_min, stam_max), &self.specs),
Stat::BlueShield => self.blue_shield.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::RedShield => self.red_shield.set(rng.gen_range(stat_min, stat_max), &self.specs),
Stat::Evasion => self.evasion.set(rng.gen_range(evasion_min, evasion_max), &self.specs),
@ -249,7 +245,7 @@ impl Cryp {
self.roll_stat(Stat::RedDamage);
self.roll_stat(Stat::BlueDamage);
self.roll_stat(Stat::Speed);
self.roll_stat(Stat::Stamina);
self.roll_stat(Stat::Hp);
self
}
@ -276,10 +272,7 @@ impl Cryp {
self.blue_shield.recalculate(&self.specs);
self.evasion.recalculate(&self.specs);
self.speed.recalculate(&self.specs);
// special case where hp is tied to stam
self.stamina.recalculate(&self.specs);
self.hp.set(self.stamina.value, &self.specs);
self.hp.recalculate(&self.specs);
self
}
@ -406,7 +399,7 @@ impl Cryp {
}
// pub fn rez(&mut self) -> &mut Cryp {
// self.hp.set(self.stamina.base);
// self.hp.set(self.hp.base);
// self
// }
@ -449,10 +442,6 @@ impl Cryp {
self.hp.value
}
pub fn stamina(&self) -> u64 {
self.stamina.value
}
pub fn heal(&mut self, skill: Skill, amount: u64) -> ResolutionResult {
let immunity = self.immune(skill);
let immune = immunity.immune;
@ -478,7 +467,7 @@ impl Cryp {
let current_hp = self.hp();
let new_hp = *[
self.hp().saturating_add(modified_healing),
self.stamina()
self.hp.max
].iter().min().unwrap();
let healing = new_hp - current_hp;
@ -597,7 +586,7 @@ impl Cryp {
}
let mut rng = thread_rng();
let hp_pct = (self.hp.value * 100) / self.stamina.value;
let hp_pct = (self.hp.value * 100) / self.hp.value;
let evasion_rating = (self.evasion.value * hp_pct) / 100;
let roll = rng.gen_range(0, 100);
println!("{:} < {:?}", roll, evasion_rating);

View File

@ -20,7 +20,7 @@ pub enum ItemAction {
RerollRedDamage,
RerollBlueDamage,
RerollSpeed,
RerollStamina,
RerollHp,
RerollRedShield,
RerollBlueShield,
RerollEvasion,
@ -52,7 +52,7 @@ impl Item {
fn apply(&mut self, tx: &mut Transaction, target: Uuid) -> Result<(), Error> {
match self.action {
ItemAction::RerollStamina => reroll(self, tx, target, Stat::Stamina),
ItemAction::RerollHp => reroll(self, tx, target, Stat::Hp),
ItemAction::RerollRedDamage => reroll(self, tx, target, Stat::RedDamage),
ItemAction::RerollBlueDamage => reroll(self, tx, target, Stat::BlueDamage),
ItemAction::RerollSpeed => reroll(self, tx, target, Stat::Speed),
@ -85,7 +85,7 @@ fn reroll(item: &mut Item, tx: &mut Transaction, target: Uuid, stat: Stat) -> Re
fn mode_drops(mode: GameMode) -> Vec<(ItemAction, usize)> {
match mode {
GameMode::Normal => vec![
(ItemAction::RerollStamina, 1),
(ItemAction::RerollHp, 1),
(ItemAction::RerollRedDamage, 1),
(ItemAction::RerollBlueDamage, 1),
],
@ -103,7 +103,7 @@ fn mode_drops(mode: GameMode) -> Vec<(ItemAction, usize)> {
(ItemAction::RerollSpeed, 1),
],
// _ => vec![
// (ItemAction::RerollStamina, 1),
// (ItemAction::RerollHp, 1),
// (ItemAction::RerollRedDamage, 1),
// (ItemAction::RerollBlueDamage, 1),
// (ItemAction::RerollSpeed, 1),

View File

@ -1045,7 +1045,7 @@ mod tests {
y.reduce_effect_durations(&mut log);
let _decay = y.effects.iter().find(|e| e.effect == Effect::Decay);
// assert!(y.hp() == y.stamina().saturating_sub(decay.unwrap().tick.unwrap().amount));
// assert!(y.hp() == y.hp().saturating_sub(decay.unwrap().tick.unwrap().amount));
}
#[test]

View File

@ -3,7 +3,7 @@ use cryp::{Stat};
#[derive(Debug,Copy,Clone,Serialize,Deserialize,PartialEq)]
pub enum Spec {
SpeedI,
StaminaI,
HpI,
RedDamageI,
GreenDamageI,
BlueDamageI,
@ -20,7 +20,7 @@ impl Spec {
Spec::RedShieldI => Stat::RedShield,
Spec::BlueShieldI => Stat::BlueShield,
Spec::SpeedI => Stat::Speed,
Spec::StaminaI => Stat::Stamina,
Spec::HpI => Stat::Hp,
}
}
@ -30,7 +30,7 @@ impl Spec {
Spec::GreenDamageI => modified + (base * 5 / 100),
Spec::BlueDamageI => modified + (base * 5 / 100),
Spec::SpeedI => modified + (base * 5 / 100),
Spec::StaminaI => modified + (base * 5 / 100),
Spec::HpI => modified + (base * 5 / 100),
Spec::RedShieldI => modified + 50,
Spec::BlueShieldI => modified + 50,
}

View File

@ -33,17 +33,15 @@ pub enum Var {
// specs
Damage,
Protection,
Hp,
Speed,
Stamina,
StaminaI,
HpI,
RedDamageI,
BlueDamageI,
GreenDamageI,
RedShieldI,
BlueShieldI,
SpeedI,
Amplify,
Banish,
@ -87,7 +85,7 @@ impl Var {
Var::Debuff |
Var::Buff => true,
Var::Protection |
Var::Hp |
Var::Damage => true,
_ => false,
@ -137,13 +135,16 @@ impl Var {
fn spec(&self) -> Option<Spec> {
match *self {
Var::StaminaI => Some(Spec::StaminaI),
Var::SpeedI => Some(Spec::SpeedI),
Var::Speed => Some(Spec::SpeedI),
Var::RedDamageI => Some(Spec::RedDamageI),
Var::BlueDamageI => Some(Spec::BlueDamageI),
Var::GreenDamageI => Some(Spec::GreenDamageI),
Var::HpI => Some(Spec::HpI),
Var::RedShieldI => Some(Spec::RedShieldI),
Var::BlueShieldI => Some(Spec::BlueShieldI),
_ => None,
}
}
@ -175,8 +176,8 @@ impl Vbox {
Var::Attack,
Var::Attack,
Var::Attack,
Var::StaminaI,
Var::SpeedI,
Var::Hp,
Var::Speed,
Var::Damage,
Var::Red,
Var::Green,
@ -214,9 +215,8 @@ impl Vbox {
let specs = vec![
(Var::Damage, 1),
(Var::Protection, 1),
(Var::Hp, 1),
(Var::Speed, 1),
(Var::Stamina, 1),
];
let mut rng = thread_rng();
@ -358,16 +358,15 @@ impl Vbox {
ColourCode::GB => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => return Err(err_msg("unhandled skill combo")),
},
Var::Protection => match colour_code {
Var::Hp => match colour_code {
ColourCode::RR => Var::RedShieldI,
ColourCode::GG => Var::StaminaI,
ColourCode::GG => Var::HpI,
ColourCode::BB => Var::BlueShieldI,
ColourCode::RG => return Err(err_msg("unhandled skill combo")),
ColourCode::GB => return Err(err_msg("unhandled skill combo")),
ColourCode::BR => return Err(err_msg("unhandled skill combo")),
},
_ => panic!("wrong base {:?}", base),
};