protected Unit( string name, int x, int y, int hitPoints, int magicPoints, int damage, int defense, int accuracy, int criticalChance, int level, IList <INormalAttack> normalAttacks, IList <IMagicAttack> magicAttacks, ConsoleColor color = ConsoleColor.White, StatusAilment statusAilment = DefaultAilment, int ailmentDuration = 0) : base(name, x, y, color) { this.MaxHP = hitPoints; this.MaxMP = magicPoints; this.MaxDamage = damage; this.MaxDefense = defense; this.MaxAccuracy = accuracy; this.CriticalChance = criticalChance; this.Level = level; this.NormalAttacks = normalAttacks; this.MagicAttacks = magicAttacks; this.Ailment = statusAilment; this.AilmentDuration = ailmentDuration; this.CanActThisTurn = true; this.CanUseMagic = true; this.CanUsePhysicalAttack = true; }
private void AddStatusAilment() { if (!hasGottenAStatusAilment) { if (Random.Range(0.0F, 1.0F) < chanceToGetAStatusAilment) { hasGottenAStatusAilment = true; sickIcon.enabled = true; happyIcon.enabled = false; sadIcon.enabled = false; if (Random.Range(0, 5) < 2) { status = StatusAilment.Hot; hotIcon.enabled = true; hotParticleEffect.GetComponent <ParticleSystem> ().Play(); } else { status = StatusAilment.Cold; coldIcon.enabled = true; coldParticleEffect.GetComponent <ParticleSystem> ().Play(); } } } }
public static StatusAilment GetStatusAilment(Epd epd) { StatusAilment stat = new StatusAilment(); stat.bFly = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 0); stat.bSmallDamageReaction = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 1); stat.bSmallDamageReactionOnly = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 2); stat.bHitback = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 3); stat.bPoison = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 10); stat.bSlow = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 11); stat.bStop = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 12); stat.bBind = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 13); stat.bFaint = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 14); stat.bFreeze = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 15); stat.bBurn = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 16); stat.bConfuse = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 17); stat.bBlind = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 18); stat.bDeath = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 19); stat.bZeroGravity = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 20); stat.bMini = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 21); stat.bMagnet = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 22); stat.bDegen = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 23); stat.bSleep = BitsUtil.Int.GetBit((int)epd.generalParameters.StatusAilmentsFlag, 24); return(stat); }
public void RemoveStatusAilment(string ailment) { StatusAilment status = _ailments[ailment]; _ailments.Remove(ailment); status.Recover(_entity); Object.Destroy(status); }
public void TickAilmentEffect(StatusAilment status) { if (_ailments.ContainsKey(status.name)) { StatusAilment s = _ailments[status.name]; s.TickEffect(_entity); } }
public void HealDragon() { status = StatusAilment.None; sickIcon.enabled = false; hotIcon.enabled = false; hotParticleEffect.GetComponent <ParticleSystem> ().Stop(); coldIcon.enabled = false; coldParticleEffect.GetComponent <ParticleSystem> ().Stop(); }
public void AddStatusAilment(StatusAilment ailment) { if (_ailments.ContainsKey(ailment.name)) { _ailments[ailment.name].StackWith(_entity, ailment); } else { _ailments.Add(ailment.name, ailment); ailment.ApplyTo(_entity); } }
public void DecrementAilmentDuration(StatusAilment status) { if (_ailments.ContainsKey(status.name)) { StatusAilment s = _ailments[status.name]; s.DecrementDuration(); if (s.duration <= 0) { RemoveStatusAilment(s.name); } } }
public override void StackWith(Fighter p, StatusAilment other) { if (this.name == other.name) { this.level = (int)Mathf.Max(this.level, other.level); this.duration = (int)Mathf.Max(this.duration, other.duration); } else { Debug.LogError("Attempting to stack " + this.name + " with " + other.name); } }
private void OnHeroDeath(DeathResult result) { List <PlayerObject> allPlayers = GameManager.Instance.battleComponents.field.GetActivePlayerObjects(); PlayerObject heroPlayer = GameManager.Instance.battleComponents.field.GetHeroPlayer(); heroPlayer.ApplyHeroDeathModifiers(); StatusAilment reviveStatusAilmentPrefab = GameManager.Instance.models.GetCommonStatusAilment("Hero's Miracle"); heroPlayer.ailmentController.AddStatusAilment(Instantiate(reviveStatusAilmentPrefab)); }
protected MagicAttack( string name, int mpCost, int damage, int accuracy, StatusAilment ailment = DefaultAilment, int ailmentDuration = 0) : base(name, damage, accuracy) { this.MPCost = mpCost; this.Ailment = ailment; this.AilmentDuration = ailmentDuration; }
public void SetStatusAilment(StatusAilment ailment) { this.gameObject.name = ailment.name; statusAilment = ailment; if (ailment.icon != null) { _icon.sprite = ailment.icon; } if (ailment.infiniteDuration) { _durationText.text = ""; } else { _durationText.text = ailment.duration.ToString(); } }
//------------------------------------------------------------------------ /*! * @brief カレントIDを次に表示するアイコンIDに更新 * @param[in] bool[] (array) ステータス配列 */ //------------------------------------------------------------------------ private void updateAilment() { for (int idx = 0; idx < m_Turns.Length; idx++) { m_Turns[idx] = -1; } if (m_AilmentChara != null) { for (int idx = 0; idx < m_AilmentChara.GetAilmentCount(); idx++) { StatusAilment ailment = m_AilmentChara.GetAilment(idx); if (ailment != null) { Sprite sprite = getSprite(ailment.nType); if (sprite != null) { for (int spr_idx = 0; spr_idx < m_Sprites.Length; spr_idx++) { if (sprite == m_Sprites[spr_idx]) { if (ailment.nLife > m_Turns[spr_idx]) { m_Turns[spr_idx] = ailment.nLife; } break; } } } } } } int next_index = (m_SpriteIndex + 1) % m_Sprites.Length; while (next_index != m_SpriteIndex) { if (m_Turns[next_index] >= 0) { m_SpriteIndex = next_index; break; } next_index = (next_index + 1) % m_Sprites.Length; } }
public void setupCharaAilmentInfo(StatusAilmentChara ailmentChara) { AddAilmentInfo(GameTextUtil.GetText("battle_infotext1"), -1); int count = 1; for (int num = 0; num < (int)MasterDataDefineLabel.AilmentType.MAX; ++num) { if (ailmentChara.IsHavingAilment((MasterDataDefineLabel.AilmentType)num) == false) { continue; } int turn = 0; string detail = ""; // 残りターン数を取得 for (int n = 0; n < ailmentChara.GetAilmentCount(); ++n) { StatusAilment status_ailment = ailmentChara.GetAilment(n); if (status_ailment == null) { continue; } MasterDataDefineLabel.AilmentType type = status_ailment.nType; if (type != (MasterDataDefineLabel.AilmentType)num) { continue; } turn = status_ailment.nLife; MasterDataStatusAilmentParam master = MasterDataUtil.GetMasterDataStatusAilmentParam(status_ailment.nMasterDataStatusAilmentID); detail = master.detail; if (detail == "") { detail = master.name; } break; } AddAilmentInfo(detail, turn); ++count; } if (count == 1) { AddAilmentInfo("-", -1); } }
public bool TryInflictAilment(AilmentInfliction infliction) { if (Random.value <= infliction.chance) { StatusAilment ailment = Object.Instantiate(infliction.statusAilment); if (infliction.infiniteDuration) { ailment.SetInfiniteDuration(); } else if (infliction.duration != 0) { ailment.SetDuration(infliction.duration); } AddStatusAilment(ailment); return(true); } return(false); }
public static void outputAilment(StatusAilmentChara chara_ailment) { for (int idx = 0; idx < chara_ailment.cAilment.Length; idx++) { StatusAilment ailment = chara_ailment.cAilment[idx]; if (ailment != null && ailment.bUsed ) { MasterDataStatusAilmentParam ailment_master = BattleParam.m_MasterDataCache.useAilmentParam((uint)ailment.nMasterDataStatusAilmentID); DebugBattleLog.writeText(DebugBattleLog.StrOpe + " 状態変化" + " FixID:" + ailment.nMasterDataStatusAilmentID.ToString() + " 効果種類:" + ailment.nType.ToString() + " 残ターン数:" + ailment.nLife + " 発動者ATK:" + ailment.nBaseAtk + " 受動者HP:" + ailment.nBaseHPMax + ((ailment_master != null) ? " 効果値(割合):" + ailment_master.Get_VALUE_RATE() : "") + ((ailment_master != null) ? " 効果値(固定):" + ailment_master.Get_VALUE_FIX() : "") + " [" + ((ailment_master != null) ? ailment_master.name : "") + "]" ); } } }
public override void StackWith(Fighter p, StatusAilment other) { }
public override void StackWith(Fighter p, StatusAilment other) { // Doesn't stack Debug.LogError("Should not attempt to apply two of these"); }
public override void StackWith(Fighter p, StatusAilment other) { StatBuffAilment otherAilment = (StatBuffAilment)other; this.ApplyHelper(p, otherAilment); }
public override void Initialize(Fighter player) { // Note: Randomization/dynamic description should be done here. // Be sure to instantiate the scriptable object before you call this this.ailment = Instantiate(ailment); }
public abstract void StackWith(Fighter p, StatusAilment other);
private void setSkillInfo() { int panel_put_count_base = PANEL_PUT_COUNT_BASE; #if BUILD_TYPE_DEBUG // パネル配置数をデバッグメニューの値で上書き { int debug_panel_put_count = BattleDebugMenu.getAutoPlayPanelPutCount(); if (debug_panel_put_count > 0) { panel_put_count_base = debug_panel_put_count; } } #endif //BUILD_TYPE_DEBUG m_SkillWorksInfo.init(panel_put_count_base); // オートプレイスキルの効果を集約 bool is_applied_ailment = false; for (int member_idx = 0; member_idx < MEMBER_ORDER.Length; member_idx++) { GlobalDefine.PartyCharaIndex member_type = MEMBER_ORDER[member_idx]; CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(member_type, CharaParty.CharaCondition.SKILL_PASSIVE); if (chara_once != null) { #if BUILD_TYPE_DEBUG // デバッグメニューで設定されたスキルを適用 { MasterDataDefineLabel.AutoPlaySkillType[] debug_skills = BattleDebugMenu.getAutoPlaySkill(member_type); if (debug_skills.IsNullOrEmpty() == false) { for (int debug_skill_idx = 0; debug_skill_idx < debug_skills.Length; debug_skill_idx++) { MasterDataDefineLabel.AutoPlaySkillType debug_skill_type = debug_skills[debug_skill_idx]; m_SkillWorksInfo.applySkill(debug_skill_type, member_type, false); } } } #endif //BUILD_TYPE_DEBUG // メインユニットのパッシブスキル { MasterDataSkillPassive passive_skill_master = BattleParam.m_MasterDataCache.useSkillPassive(chara_once.m_CharaMasterDataParam.skill_passive); if (passive_skill_master != null) { m_SkillWorksInfo.applySkill(passive_skill_master, member_type, false); } } // リンクユニットのパッシブスキル if (chara_once.m_LinkParam != null && chara_once.m_LinkParam.m_CharaID != 0 ) { MasterDataParamChara link_chara_master = BattleParam.m_MasterDataCache.useCharaParam(chara_once.m_LinkParam.m_CharaID); if (link_chara_master != null) { MasterDataSkillPassive link_passive_skill_master = BattleParam.m_MasterDataCache.useSkillPassive(link_chara_master.link_skill_passive); if (link_passive_skill_master != null) { m_SkillWorksInfo.applySkill(link_passive_skill_master, member_type, true); } } } // 状態異常にあるオートプレイ用スキルを反映 if (is_applied_ailment == false) { is_applied_ailment = true; StatusAilmentChara status_ailment_chara = BattleParam.m_PlayerParty.m_Ailments.getAilment(member_type); if (status_ailment_chara != null) { for (int ailment_idx = 0; ailment_idx < status_ailment_chara.GetAilmentCount(); ailment_idx++) { StatusAilment status_ailment = status_ailment_chara.GetAilment(ailment_idx); if (status_ailment != null) { if (status_ailment.nType == MasterDataDefineLabel.AilmentType.AUTO_PLAY_SKILL) { MasterDataStatusAilmentParam ailment_param = BattleParam.m_MasterDataCache.useAilmentParam((uint)status_ailment.nMasterDataStatusAilmentID); if (ailment_param != null) { MasterDataDefineLabel.AutoPlaySkillType auto_play_skill_type = ailment_param.Get_AUTO_PLAY_SKILL_TYPE(); m_SkillWorksInfo.applySkill(auto_play_skill_type, member_type, false); } } } } } } } } m_SkillWorksInfo.fix(); }