public string GetDescription(RPGSettings.DamageType damageType) { string desc = (modifier > 0 ? "+" : "") + modifier + (RPGSettings.IsMez(stat) ? " " : "% to "); if (stat <= RPGSettings.StatName.Def) { desc += damageType.ToString() + " "; } desc += stat.ToString(); return(desc); }
public override void ApplyDamage(float damage, RPGSettings.DamageType dt) { // factor in resistance and subtract damage base.ApplyDamage(damage, dt); // interrupt any ongoing maintains/charges with damage if (activePower && activePower.interruptable) { activePower.OnEnd(this, true); } }
public HitResponse.ReflectionType GetReflection(RPGSettings.DamageType type) { foreach (HitResponse hr in hitResponses) { if (hr.reflection != HitResponse.ReflectionType.None && Random.Range(0, 100) < hr.percentage && (hr.damageType & type) != 0) { hr.PlayEffect(this); return(hr.reflection); } } return(HitResponse.ReflectionType.None); }
public virtual void ApplyDamage(float damage, RPGSettings.DamageType dt) { if (dead) { return; } // apply damage resistance if (dt != RPGSettings.DamageType.Healing) { damage *= GetFactor(-stats[RPGSettings.GetResistanceStat(dt)].currentValue); } health -= damage; if (health <= 0) { // die! if (explosion) { explosion.Explode(GetBodyPart(Character.BodyPart.Chest), null); } dead = true; RPGSettings.instance.RemoveCharacter(this); foreach (Character ch in Power.getAll()) { if (ch.target == this) { ch.target = null; } } OnDeath(); } int dmg = (int)Mathf.Abs(damage); NumberFloat(dmg.ToString(), damage > 0 ? Color.red : Color.green); // TODO if we don't have a HUD yet, add a healthbar to props? RPGSettings.instance.SetupCharacter(this); }
protected void MakeFire() { tint.code = RPGSettings.ColorCode.Fire; type = RPGSettings.DamageType.Fire; AddStatus(LoadAsset <Status>("Sample Powers/Flames.asset")); }