public void Attached() { //Call event OnHPChanged?.Invoke(_hp); OnMoneyChanged?.Invoke(_money); OnHonorsChanged?.Invoke(); }
public override void Damage(int damage) { if (IsGodMode || _protectedBySeaFood) { damage = 0; } _hp -= damage; if (_hp < 0) { _hp = 0; } _scene.NumberCollection.ShowNumber( this.gameObject, _playerID == 0 ? NumberCollection.Type.Violet : NumberCollection.Type.Red, (uint)damage ); if (_hp == 0) { Die(); } OnHPChanged?.Invoke(damage); }
public void pbHPChanged(Combat.Pokemon pkmn, int oldhp, bool animate = false) { if (OnHPChanged != null) { OnHPChanged.Invoke(this, new OnHPChangedEventArgs { Index = pkmn.Index, Oldhp = oldhp, Animate = animate }); } }
public void pbHPChanged(int pkmn, int oldhp, bool anim = false) { if (OnHPChanged != null) { OnHPChanged.Invoke(this, new OnHPChangedEventArgs { Index = pkmn, Oldhp = oldhp, Animate = anim }); } }
public void HPChanged(int index, int oldhp, bool animate = false) { if (OnHPChanged != null) { OnHPChanged.Invoke(this, new OnHPChangedEventArgs { Index = index, Oldhp = oldhp, Animate = animate }); } }
public override void Recovery(int recovery) { if (type == HouseType.Master) { return; } _hp += recovery; _numberCollection.ShowNumber(this.gameObject, NumberCollection.Type.Blue, (uint)recovery); OnHPChanged?.Invoke(this); }
public override void Recovery(int recover) { _hp += recover; if (_hp > MAX_HP) { _hp = MAX_HP; } OnHPChanged?.Invoke(recover); }
public void ResetPlayer(Vector3 respawnPoint) { _hp = _data.hp; OnHPChanged?.Invoke(_hp); transform.position = respawnPoint; transform.rotation = Quaternion.Euler(0.0f, 0.0f, 0.0f); if (!isActiveAndEnabled) { gameObject.SetActive(true); } if (_protector.activeSelf) { _protector.SetActive(false); } }
private void GetDamage() { // If the protector is activated, get no damage if (_protector.activeSelf) { return; } if (!takeNoDamage && --_hp == 0) { LevelManager.Instance.GameOver(); gameObject.SetActive(false); } else { _protector.SetActive(true); } OnHPChanged?.Invoke(_hp); }
public override void Damage(int attack) { if (type == HouseType.Master) { return; } _hp -= attack; _numberCollection.ShowNumber( this.gameObject, _playerID == 0 ? NumberCollection.Type.Violet : NumberCollection.Type.Red, (uint)attack ); _audio.PlayOneShot(_damageClip); OnHPChanged?.Invoke(this); if (_hp <= 0) { Die(); } }
public void CallHpChanged(float value) { OnHPChanged?.Invoke(value); }
public void DecreaseHP(int damage) { HP = Mathf.Clamp(HP - damage, 0, MaxHP); OnHPChanged?.Invoke(); }
public void IecreaseHP(int amount) { HP = Mathf.Clamp(HP + amount, 0, MaxHP); OnHPChanged?.Invoke(); }