Added healing healthsource logic to shockwave system.

This commit is contained in:
Sam 2020-09-11 13:07:09 -05:00
parent 6a1acd47a1
commit 99aba78422
3 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
Item(
ItemDef(
name: "Stone Golem's Fist",
description: "Was attached to a mighty stone golem.",
kind: Tool(

View File

@ -74,7 +74,7 @@ impl LoadoutBuilder {
Body::Golem(golem) => match golem.species {
golem::Species::StoneGolem => {
main_tool = Some(Item::new_from_asset_expect(
"common.items.weapons.bossweapon.stone_golems_fist",
"common.items.npc_weapons.npcweapon.stone_golems_fist",
));
},
},

View File

@ -203,7 +203,7 @@ impl<'a> System<'a> for Sys {
damage.modify_damage(block, loadout);
}
if damage.healthchange != 0.0 {
if damage.healthchange < 0.0 {
server_emitter.emit(ServerEvent::Damage {
uid: *uid_b,
change: HealthChange {
@ -213,6 +213,16 @@ impl<'a> System<'a> for Sys {
},
},
});
} else if damage.healthchange > 0.0 {
server_emitter.emit(ServerEvent::Damage {
uid: *uid_b,
change: HealthChange {
amount: damage.healthchange as i32,
cause: HealthSource::Healing {
by: Some(shockwave.owner.unwrap_or(*uid)),
},
},
});
}
if shockwave.knockback != 0.0 && damage.healthchange != 0.0 {
if shockwave.knockback < 0.0 {