private bool DeathBlowMagicalRecipe(ManageDungeon dun) { if (PowerValue <= 1) { DisplayInformation.Info.AddMessage( CommonConst.Message.DeathBlowNotPower); return(false); } //メッセージの追加 AttackInfo.AddMessage(string.Format(CommonConst.Message.DeathBlowMagicalRecipe, this.DisplayNameInMessage)); AttackInfo.AddMessage(string.Format(CommonConst.Message.DeathBlowMagicalRecipe2, this.DisplayNameInMessage)); EffectFlareCore ef = EffectFlareCore.CreateObject(this, EffectFlareCore.FLareCoreType.Blue); AttackInfo.AddEffect(ef); //声を鳴らす this.AttackInfo.AddVoice(VoiceInformation.VoiceType.Deathblow); ManageAtelier.IsSuccess = true; //Power減らす ReducePower(1); return(true); }
/// <summary> /// 食べる /// </summary> public override bool Eat(ManageDungeon dun, BaseCharacter player) { DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.EatItem, this.DisplayNameInMessage)); switch (FType) { case FoodType.Common: this.CommonUseItem(player); break; case FoodType.Fly: DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.BadFood, player.DisplayNameInMessage)); this.CommonUseItem(player); break; case FoodType.Curry: this.CommonUseItem(player); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverPower)); player.RecoverPower(99); break; case FoodType.Handmaid: this.CommonUseItemCustom(dun, player, player); break; } return(true); }
public void TrapBreaker(ManageDungeon dun, BaseCharacter target) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.AttackHit); //自オブジェクトとの距離を取得 int dist = CurrentPoint.DistanceAbs(target.CurrentPoint); MapPoint vector = CommonFunction.CharacterDirectionVector[target.Direction]; MapPoint checkpoint = target.CurrentPoint; dun.SetUpTrapMap(); //対象位置までのトラップをすべて破壊 for (int i = 0; i <= dist; i++) { BaseTrap tr = dun.TrapMap.Get(checkpoint); if (CommonFunction.IsNull(tr) == false) { EffectSmoke.CreateObject(tr, false).Play(); dun.RemoveTrap(tr); ManageDungeon.KillObjectNow(tr); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapBreak, tr.DisplayNameInMessage, CommonFunction.StateNames[StateAbnormal.Slow])); } //1マス先を取得 checkpoint = checkpoint.Add(vector); } }
/// <summary> /// オプションによる防御力返還 /// </summary> /// <param name="weapon"></param> /// <returns></returns> public float DefenceValue(ManageDungeon dun, BaseCharacter attacker, BaseCharacter target, float itemdef) { float def = 0; switch (OType) { //防御+ case OptionType.Defence: def = Plus * CommonFloat; break; //種族特防 case OptionType.DefenceRace: if ((target.Race & RaceTarget) != 0) { def = itemdef * Plus * CommonFloat; } break; //鉄壁 case OptionType.IronWall: dun.SetUpCharacterMap(); //dun.GetNearCharacters(target.CurrentPoint, 1); if (dun.GetNearCharacters(attacker.CurrentPoint, 1).Count > 2) { def = itemdef * Plus * CommonFloat; } break; } return(def); }
/// <summary> /// 投げる効果(誰かに当たった時) /// </summary> public virtual bool ThrowAction(ManageDungeon dun, PlayerCharacter player, BaseCharacter target) { if (CommonFunction.IsRandom(ThrowDexterity) == true) { //あたりメッセージ DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.HitThrowAfter, target.DisplayNameInMessage)); //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.AttackHit); int damage = Mathf.CeilToInt((ItemAttack + ItemDefence + StrengthValue) * 2); AttackState atState = target.AddDamage(damage); //ダメージエフェクト EffectDamage d = EffectDamage.CreateObject(target); d.SetText(damage.ToString(), AttackState.Hit); d.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( target.GetMessageAttackHit(damage)); //対象が死亡したら if (atState == AttackState.Death) { DisplayInformation.Info.AddMessage( target.GetMessageDeath(target.HaveExperience)); if (target.Type == ObjectType.Player) { ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Throw, DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Throw; } player.Death(target, player.AttackInfo); target.DeathAction(dun); } IsThrowBreak = true; return(true); } else { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Put); DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.AttackMissPlayer, target.DisplayNameInMessage)); DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.DropItem, this.DisplayNameInMessage)); return(false); } }
/// <summary> /// 投げる効果(誰にも当たらなかったとき) /// </summary> public override bool ThrowDrop(ManageDungeon dun, PlayerCharacter player) { switch (BType) { case BallType.Trap: TrapBreaker(dun, player); break; } Options = null; return(true); }
public override bool ThrowAction(ManageDungeon dun, PlayerCharacter player, BaseCharacter target) { if (CommonFunction.IsRandom(ThrowDexterity) == false) { DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.AttackMissPlayer, target.DisplayNameInMessage)); Options = null; return(true); } //あたりメッセージ DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.HitThrowAfter, target.DisplayNameInMessage)); return(ThrowActionEffect(dun, player, target)); }
/// <summary> /// オプションによる攻撃力返還 /// </summary> /// <param name="weapon"></param> /// <returns></returns> public float AttackValue(ManageDungeon dun, BaseCharacter attacker, BaseCharacter target, float itematk) { float atk = 0; switch (OType) { //攻撃+ case OptionType.Attack: atk = Plus * CommonFloat; break; //種族特攻 case OptionType.AttackRace: if ((target.Race & RaceTarget) == 0) { atk = itematk * Plus * CommonFloat; } break; //逆境 case OptionType.Adversity: if ((attacker.CurrentHp / attacker.MaxHp) < 0.2f) { atk = itematk * Plus * CommonFloat; } break; //打開 case OptionType.Breakthrough: dun.SetUpCharacterMap(); if (dun.GetNearCharacters(attacker.CurrentPoint, 1).Count > 2) { atk = itematk * Plus * CommonFloat; } break; //鉄塊 case OptionType.Liquid: if (CommonFunction.IsRandom(CommonFloat) == true) { atk = target.Defense / 4; } break; } return(atk); }
public void SetVisibleLight(RoomInformation visible, ManageDungeon dun, PlayerCharacter player) { //非活性なら動かさない if (IsActive == false) { return; } //float rate = 1 / Time.smoothDeltaTime; //MoveNum = Mathf.CeilToInt(15 * (60 * Time.smoothDeltaTime)); //Debug.Log(MoveNum); //if(MoveNum > 30) //{ // MoveNum = 30; //} //左の10ユニット分空いた点を取得 LTV = new Vector3(visible.Left - 10, 3.05f, player.CurrentPoint.Y); lspeed = (left.transform.localPosition - LTV).magnitude / MoveNum; //右 RTV = new Vector3(visible.Right + 10, 3.05f, player.CurrentPoint.Y); rspeed = (right.transform.localPosition - RTV).magnitude / MoveNum; float dist = visible.Right - visible.Left + 1; float posx = (visible.Right + visible.Left) / 2; if (dist % 2 == 0) { posx += 0.5f; } //上 TTV = new Vector3(posx, 3.05f, visible.Bottom + 10); tspeed = (top.transform.localPosition - TTV).magnitude / MoveNum; tsspeed = new Vector3((dist - top.transform.localScale.x) / MoveNum, 0, 0); tTargetScale = new Vector3(dist, top.transform.localScale.y, top.transform.localScale.z); //下 BTV = new Vector3(posx, 3.05f, visible.Top - 10); bspeed = (bottom.transform.localPosition - BTV).magnitude / MoveNum; bsspeed = new Vector3((dist - bottom.transform.localScale.x) / MoveNum, 0, 0); bTargetScale = new Vector3(dist, bottom.transform.localScale.y, bottom.transform.localScale.z); MoveNow = 0; }
/// <summary> /// 投げる効果(誰にも当たらなかったとき) /// </summary> public virtual bool ThrowDrop(ManageDungeon dun, PlayerCharacter player) { if (IsThrowVanish == true) { DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.VanishItem, this.DisplayNameInMessage)); return(true); } else if (dun.Dungeon.DungeonMap.Get(this.CurrentPoint).State == LoadStatus.Water) { DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.WaterInItem, this.DisplayNameInMessage)); return(true); } else { DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.DropItem, this.DisplayNameInMessage)); return(false); } }
/// <summary> /// 必殺技の発動 /// </summary> public override bool DeathBlow(ManageDungeon dun) { switch (PlayerInformation.Info.PType) { case PlayerType.UnityChan: //現在位置に強制移動(モーションによるフレームずれを補正) ResetObjectPosition(); //ターンカウントを更新 RestActionTurn--; //必殺技実行 if (DeathBlowMagicalRecipe(dun) == true) { ActType = ActionType.DeathBlow; return(true); } break; case PlayerType.OricharChan: //現在位置に強制移動(モーションによるフレームずれを補正) ResetObjectPosition(); //ターンカウントを更新 RestActionTurn--; //必殺技実行 if (DeathBlowKugeltanz(dun) == true) { ActType = ActionType.DeathBlow; _isEndAnima = false; return(true); } break; } return(false); }
/// <summary> /// ダメージ効果の変換 /// </summary> /// <param name="dun"></param> /// <param name="attacker"></param> /// <param name="target"></param> /// <param name="damage"></param> /// <returns></returns> public int DamageAttack(ManageDungeon dun, BaseCharacter attacker, BaseCharacter target, int damage) { int dmg = damage; switch (OType) { //致命 case OptionType.Fatal: if (target.CurrentHp > damage) { if (CommonFunction.IsRandom(CommonFloat * Plus) == true) { dmg = (int)target.CurrentHp - 1; } } break; } return(dmg); }
public BaseTrap[] TurnAction(ManageDungeon dun) { //効果発動 switch (TType) { case TrapType.Ember: int wf = 0; if (CommonFunction.IsNull(Options) == false) { foreach (BaseOption o in Options) { if (o.OType == OptionType.Wildfire) { wf = o.Plus; o.Plus--; } } } //燃え広がる if (wf > 0) { //周囲からトラップのない位置を取得 MapPoint point = dun.GetEmptyTrapPoint(CurrentPoint); //場所が取得できたら燃え広がる if (CommonFunction.IsNull(point) == false) { BaseTrap trap = TableTrap.GetTrap(CommonConst.ObjNo.Ember); trap.IsVisible = true; trap.SetThisDisplayTrap(CurrentPoint.X, CurrentPoint.Y); trap.Options = CommonFunction.CloneOptions(this.Options); return(new BaseTrap[] { trap }); } } break; } return(null); }
public int CalcDamage(ManageDungeon dun, BaseCharacter attacker, BaseCharacter target, int power, BaseOption[] atoptions, BaseOption[] tgoptions, float magnification) { int damage = 0; //オプションの攻撃力を取得 float optAtk = 0; foreach (BaseOption op in atoptions) { optAtk += op.AttackValue(dun, attacker, target, ItemAttack); } //オプションの防御力を取得 float optdef = 0; foreach (BaseOption op in tgoptions) { optdef += op.DefenceValue(dun, attacker, target, target.Defense); } //クリティカルの命中判定 if (CommonFunction.IsRandom(WeaponDexterityCritical) == true) { damage = CommonFunction.CalcDamage(attacker.BaseAttack, (ItemAttack + optAtk) * magnification, power, target.Defense + optdef, WeaponCritical); } else { damage = CommonFunction.CalcDamage(attacker.BaseAttack, (ItemAttack + optAtk) * magnification, power, target.Defense + optdef); } //オプションの攻撃を取得 foreach (BaseOption op in atoptions) { damage = op.DamageAttack(dun, attacker, target, damage); } //オプションの防御を取得 foreach (BaseOption op in tgoptions) { damage = op.DamageDefence(attacker, target, damage); } return(damage); }
/// <summary> /// 投げる効果(誰かに当たった時) /// </summary> public override bool ThrowAction(ManageDungeon dun, PlayerCharacter player, BaseCharacter target) { if (CommonFunction.IsRandom(ThrowDexterity) == true) { //あたりメッセージ DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.HitThrowAfter, target.DisplayNameInMessage)); Eat(dun, target); return(true); } else { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Put); DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.AttackMissPlayer, target.DisplayNameInMessage)); DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.DropItem, this.DisplayNameInMessage)); return(false); } }
private bool DeathBlowKugeltanz(ManageDungeon dun) { if (PowerValue <= 2) { DisplayInformation.Info.AddMessage( CommonConst.Message.DeathBlowNotPower); return(false); } //声を鳴らす this.AttackInfo.AddVoice(VoiceInformation.VoiceType.Deathblow); StellaDeathBlow b = this.ThisTransform.Find("Body").GetComponent <StellaDeathBlow>(); b.Character = this; DeathBlowKugeltanzBase(dun); //Power減らす ReducePower(2); return(true); }
/// <summary> /// ターン終了の初期化 /// </summary> public override void FinishTurn(ManageDungeon dun) { base.FinishTurn(dun); //指輪の壊れ判定 RingBase ring = EquipRing; if (ring.CheckBreak() == true) { ring.ForceRemoveEquip(this); RemoveItem(ring); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.BreakItem, ring.DisplayNameInMessage)); SoundInformation.Sound.Play(SoundInformation.SoundType.Break); } ring.TurnFInish(this, dun); //スコア値の更新 if (typeof(RingFreeHand) != ring.GetType()) { ring.TotalRing++; if (ring.TotalRing > ScoreInformation.Info.MostUseRingDamage) { ScoreInformation.Info.MostUseRingDamage = ring.TotalRing; ScoreInformation.Info.MostUseRingName = ring.DisplayNameNormal; } } //満腹度処理 if (SatietyValue <= 0) { //0を下回ったらHpが減少 CurrentHp--; if (CurrentHp <= 0) { DisplayInformation.Info.AddMessage(GetMessageDeath()); ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Hunger, DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Hunger; Death(this, this.AttackInfo); DeathAction(dun); } //未危険告知の状態で下回ったらメッセージを表示 if (IsSatietyDanger == false) { SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); DisplayInformation.Info.AddMessage(CommonConst.Message.HungryDanger); IsSatietyDanger = true; } } else { //Hpの回復 if (CurrentHp < MaxHp) { CurrentHp += TrunRecoverHp; if (CurrentHp > MaxHp) { CurrentHp = MaxHp; } } //満腹度の減少 SatietyValue -= SatietyReduce; //未警告の状態で警告値を下回ったらメッセージを表示 if (IsSatietyCaution == false && SatietyValue < CommonConst.Status.SatietyCautionTiming) { SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); DisplayInformation.Info.AddMessage(CommonConst.Message.HungryCaution); IsSatietyCaution = true; } } }
/// <summary> /// 投げる効果(誰かに当たった時) /// </summary> private bool ThrowActionEffect(ManageDungeon dun, PlayerCharacter player, BaseCharacter target) { switch (BType) { case BallType.Fire: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Bomb); int damage = FireBallFixDamage + Mathf.FloorToInt(player.BaseAttack * 2); AttackState atState = target.AddDamage(damage); //ボールエフェクト EffectFireBallLanding.CreateObject(target).Play(); //ダメージエフェクト EffectDamage d = EffectDamage.CreateObject(target); d.SetText(damage.ToString(), AttackState.Hit); d.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( target.GetMessageAttackHit(damage)); //対象が死亡したら if (atState == AttackState.Death) { if (target.Type == ObjectType.Player) { ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Item, this.DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Item; } DisplayInformation.Info.AddMessage( target.GetMessageDeath(target.HaveExperience)); player.Death(target, player.AttackInfo); target.DeathAction(dun); } break; case BallType.Gyro: SoundInformation.Sound.Play(SoundInformation.SoundType.BucketFall); //ターゲットが吹き飛ぶ先のポイントを取得 bool isWall; MapPoint point = dun.GetBlow(target.CurrentPoint, Direction, out isWall); //対象のポイントが取得できなければ if (CommonFunction.IsNull(point) == true) { } //対象ポイントが取得できればそこに移動 else { if (typeof(BaseEnemyCharacter) == target.GetType()) { ((BaseEnemyCharacter)target).MoveState = EnemySearchState.FightPlayer; } DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.BlowCharacter, target.DisplayNameInMessage)); target.BlowDirection = Direction; target.BlowPoint = point; target.MoveSpeed = CommonConst.SystemValue.MoveSpeedDash; dun.MoveCharacter(point, target); //対象に衝突ダメージ if (isWall == true) { target.BlowAfterDamage = GyroFixDamage; } //吹っ飛び先に誰かがいた場合 MapPoint vector = CommonFunction.CharacterDirectionVector[Direction]; MapPoint next = MapPoint.Get(point.X + vector.X, point.Y + vector.Y); BaseCharacter second = dun.CharacterMap.Get(point.X, point.Y); if (CommonFunction.IsNull(second) == false) { second.BlowAfterDamage = GyroFixDamage; second.BlowPoint = second.CurrentPoint; } } break; case BallType.Change: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); if (typeof(BaseEnemyCharacter) == target.GetType()) { ((BaseEnemyCharacter)target).MoveState = EnemySearchState.FightPlayer; } //ターゲットとプレイヤーの場所を交換 EffectSmoke.CreateObject(target).Play(); EffectSmoke.CreateObject(player).Play(); MapPoint tarp = target.CurrentPoint; target.SetPosition(player.CurrentPoint.X, player.CurrentPoint.Y); player.SetPosition(tarp.X, tarp.Y); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.ChangePoint, target.DisplayNameInMessage)); break; case BallType.Pickoff: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //対象に混乱を付与 int result = target.AddStateAbnormal((int)StateAbnormal.Confusion); //対象が混乱になったらメッセージを表示 if (result != 0) { EffectSmoke.CreateObject(target).Play(); DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Confusion, target)); } break; case BallType.Bean: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //対象に麻痺を付与 int bresult = target.AddStateAbnormal((int)StateAbnormal.Palalysis); //対象が麻痺になったらメッセージを表示 if (bresult != 0) { EffectSmoke.CreateObject(target).Play(); DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Palalysis, target)); } break; case BallType.Decoy: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //対象にデコイを付与 int dresult = target.AddStateAbnormal((int)StateAbnormal.Decoy); //対象がデコイになったらメッセージを表示 if (dresult != 0) { EffectSmoke.CreateObject(target).Play(); DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Decoy, target)); } break; case BallType.Slow: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //対象にスローを付与 int sresult = target.AddStateAbnormal((int)StateAbnormal.Slow); //対象がスローになったらメッセージを表示 if (sresult != 0) { EffectSmoke.CreateObject(target).Play(); DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Slow, target)); } break; //ナックル case BallType.Knuckle: List <BallType> blist = new List <BallType>(); foreach (BallType val in Enum.GetValues(typeof(BallType))) { blist.Add(val); } blist.Remove(BallType.Knuckle); blist.Remove(BallType.Handmaid); //ナックル以外の効果をランダムで取得 BallType temp = blist[UnityEngine.Random.Range(0, blist.Count)]; BallBase b = new BallBase(); b.CurrentPoint = CurrentPoint; b.Direction = Direction; b.BType = temp; //効果を発動 b.ThrowActionEffect(dun, player, target); break; case BallType.Trap: TrapBreaker(dun, player); break; case BallType.Handmaid: //ヒットエフェクト EffectFireBallLanding.CreateObject(target).Play(); //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.AttackHit); //範囲拡大がついているとき int plus; float cf; int dist = 0; if (CommonFunction.HasOptionType(this.Options, OptionType.Wildfire, out plus, out cf) == true) { dist = plus; } dun.SetUpCharacterMap(); List <BaseCharacter> targets = dun.GetNearCharacters(target.CurrentPoint, dist, true); foreach (BaseCharacter t in targets) { //int damage2 = FireBallFixDamage + Mathf.FloorToInt(player.BaseAttack * 2); int damage2 = Mathf.FloorToInt((15 + player.BaseAttack) / (target.CurrentPoint.DistanceAbs(t.CurrentPoint) + 1)); //効果増幅があったら if (CommonFunction.HasOptionType(this.Options, OptionType.EffectUp, out plus, out cf) == true) { damage2 = damage2 + plus * (int)cf; } //効果縮小があったら if (CommonFunction.HasOptionType(this.Options, OptionType.EffectDown, out plus, out cf) == true) { damage2 = damage2 - plus * (int)cf; } //ダメージ増減30% float rand = 0.3f; if (CommonFunction.HasOptionType(this.Options, OptionType.EffectStabile, out plus, out cf) == true) { rand -= cf * plus; } else if (CommonFunction.HasOptionType(this.Options, OptionType.EffectNotStabile, out plus, out cf) == true) { rand += cf * plus; } damage2 += Mathf.CeilToInt(UnityEngine.Random.Range(-rand * damage2, rand * damage2)); //通常ダメージの場合 if (CommonFunction.HasOptionType(this.Options, OptionType.ReverceDamage) == false) { AttackState atState2 = t.AddDamage(damage2); //ダメージエフェクト EffectDamage d2 = EffectDamage.CreateObject(t); d2.SetText(damage2.ToString(), AttackState.Hit); d2.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( t.GetMessageAttackHit(damage2)); //対象が死亡したら if (atState2 == AttackState.Death) { DisplayInformation.Info.AddMessage( t.GetMessageDeath(t.HaveExperience)); if (t.Type == ObjectType.Player) { ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Item, this.DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Item; t.Death(); } else { if (IsExp == true) { player.Death(t, player.AttackInfo); } else { t.Death(); } } t.DeathAction(dun); } } //基本効果反転 else { t.RecoverHp(damage2); //ヒットエフェクト EffetHitShockWave.CreateObject(t).Play(); //ダメージエフェクト EffectDamage d2 = EffectDamage.CreateObject(t); d2.SetText(damage2.ToString(), AttackState.Heal); d2.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverHp, t.DisplayNameInMessage)); } } //状態異常の付与 EffectAbnormal(targets); //火柱があれば火柱を立てる if (CommonFunction.HasOptionType(this.Options, OptionType.CatchingFire) == true) { dun.SetUpTrapMap(); if (CommonFunction.IsNull(dun.TrapMap.Get(CurrentPoint)) == true) { BaseTrap trap = TableTrap.GetTrap(CommonConst.ObjNo.Ember); trap.Options = CommonFunction.CloneOptions(this.Options); trap.IsVisible = true; trap.SetThisDisplayTrap(CurrentPoint.X, CurrentPoint.Y); dun.AddNewTrap(trap); DisplayInformation.Info.AddMessage( CommonConst.Message.TrapEmber); } } break; case BallType.Fumble: //対象のレベルが2以上ならレベルを下げる if (target.Level > 1) { if (target.Type == ObjectType.Enemy) { BaseEnemyCharacter enemy = ((BaseEnemyCharacter)target); enemy.Level--; TableEnemy.SetLevel(enemy, enemy.Level, DisplayInformation.Info.Floor, DungeonInformation.Info.EnemyHpProb, DungeonInformation.Info.EnemyAtkProb, DungeonInformation.Info.EnemyExpProb, DungeonInformation.Info.StartProbHp, DungeonInformation.Info.StartProbAtk, DungeonInformation.Info.StartProbExp); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.LevelDownPlayer, enemy.DisplayNameInMessage)); EffectBadSmoke.CreateObject(enemy).Play(); } } break; case BallType.Winning: if (target.Type == ObjectType.Enemy) { BaseEnemyCharacter enemy = ((BaseEnemyCharacter)target); enemy.Level++; TableEnemy.SetLevel(enemy, enemy.Level, DisplayInformation.Info.Floor, DungeonInformation.Info.EnemyHpProb, DungeonInformation.Info.EnemyAtkProb, DungeonInformation.Info.EnemyExpProb, DungeonInformation.Info.StartProbHp, DungeonInformation.Info.StartProbAtk, DungeonInformation.Info.StartProbExp); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.LevelUpPlayer, enemy.DisplayNameInMessage)); EffectFlareCore.CreateObject(enemy).Play(); } break; case BallType.Four: if (target.Type == ObjectType.Enemy) { BaseEnemyCharacter enemy = ((BaseEnemyCharacter)target); if (enemy.IsFourBallCount() == true) { int dam = Mathf.CeilToInt(enemy.MaxHp); AttackState atstate = target.AddDamage(dam); //ボールエフェクト EffetHitShockWave.CreateObject(enemy).Play(); //ダメージエフェクト EffectDamage dt = EffectDamage.CreateObject(target); dt.SetText(dam.ToString(), AttackState.Hit); dt.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( target.GetMessageAttackHit(dam)); SoundInformation.Sound.Play(SoundInformation.SoundType.AttackHit); //対象が死亡したら if (atstate == AttackState.Death) { if (target.Type == ObjectType.Player) { ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Item, this.DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Item; } DisplayInformation.Info.AddMessage( target.GetMessageDeath(target.HaveExperience)); player.Death(target, player.AttackInfo); target.DeathAction(dun); } } else { SoundInformation.Sound.Play(SoundInformation.SoundType.AttackHit); //ボールエフェクト EffetHitShockWave.CreateObject(enemy).Play(); } } break; case BallType.Emery: if (target.Type == ObjectType.Enemy) { BaseEnemyCharacter enemy = ((BaseEnemyCharacter)target); if (enemy.IsBoss() == false) { GameStateInformation.Info.EmeryTarget = target.ObjNo; DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.EmeryCharacter, target.DisplayNameInMessage)); List <BaseCharacter> emeryies = dun.Characters.FindAll(i => i.ObjNo == target.ObjNo); SoundInformation.Sound.Play(SoundInformation.SoundType.Summon); foreach (BaseCharacter c in emeryies) { EffectSmoke.CreateObject(c, false).Play(); dun.RemoveCharacter(c); ManageDungeon.KillObjectNow(c); } } } break; } Options = null; return(true); }
public virtual AttackState Attack(ManageDungeon dun, BaseCharacter target, BaseCharacter attacker, int power, AttackInformation atinf) { int damage = 0; atinf.AddTarget(target); //声を鳴らす atinf.AddVoice(attacker.VoiceAttack()); //攻撃の命中判定 if (CommonFunction.IsRandom(WeaponDexterity) == true) { //行動タイプを設定 atinf.SetBehType(BehaviorType.Attack); //命中したら atinf.AddHit(target, true); //声を鳴らす atinf.AddVoice(target.VoiceDefence()); //サウンドを鳴らす atinf.AddSound(GetAttackHitSound()); BaseOption[] atoptions = attacker.Options; BaseOption[] tgoptions = target.Options; //与ダメージを計算 damage = CalcDamage(dun, attacker, target, power, atoptions, tgoptions, 1); //スコア関連値の更新 if (target.Type == ObjectType.Enemy) { TotalDamage += damage; if (ScoreInformation.Info.MostUseWeaponDamage < TotalDamage) { ScoreInformation.Info.MostUseWeaponDamage = TotalDamage; ScoreInformation.Info.MostUseWeaponName = DisplayNameNormal; } ScoreInformation.Info.AddScore(damage); } //atinf.AddDamage(target.Name, damage); ////ヒットメッセージ //atinf.AddMessage( // target.GetMessageAttackHit(this.DisplayNameInMessage, damage)); ////ダメージ判定 //AttackState atState = target.AddDamage(damage); //ダメージ追加 AttackState atState = CommonFunction.AddDamage(atinf, attacker, target, damage); //ガラスアイテム判定 WeaponBase atw = attacker.EquipWeapon; foreach (BaseOption op in atw.Options) { if (op.IsBreak() == true) { atinf.AddSound(SoundInformation.SoundType.Break); atinf.AddMessage( string.Format(CommonConst.Message.BreakItem, atw.DisplayNameInMessage)); atw.ForceRemoveEquip(attacker); PlayerCharacter.RemoveItem(atw); } } ShieldBase tgs = target.EquipShield; foreach (BaseOption op in tgs.Options) { if (op.IsBreak() == true) { atinf.AddSound(SoundInformation.SoundType.Break); atinf.AddMessage( string.Format(CommonConst.Message.BreakItem, tgs.DisplayNameInMessage)); tgs.ForceRemoveEquip(target); PlayerCharacter.RemoveItem(tgs); } } //対象が死亡したら if (atState == AttackState.Death) { atinf.AddKillList(target); atinf.AddMessage( target.GetMessageDeath(target.HaveExperience)); } else { //atinf.IsDeath.Add(target.Name, false); addabnormal.Clear(); prevents.Clear(); foreach (StateAbnormal val in CommonFunction.StateAbnormals) { prevents.Add(val, 0); addabnormal.Add(val, AddAbnormalProb[val]); } int opab = 0; //オプションの付加値設定 foreach (BaseOption o in atoptions) { int ab = o.SetAbnormalAttack(addabnormal); opab = opab | ab; } int tarabn = AddAbnormal | opab; if (tarabn != 0) { //オプションによる状態異常の取得 //foreach (StateAbnormal val in CommonFunction.StateAbnormals) //{ // addabnormal.Add(val, 0); //} //オプションの抵抗値設定 foreach (BaseOption o in tgoptions) { o.SetAbnormalPrevent(prevents); } int abn = 0; //状態異常の付与 foreach (StateAbnormal val in CommonFunction.StateAbnormals) { int abnormal = (int)val & tarabn; //対象の状態異常を処理 if (abnormal != 0) { //float prob = prevents[val] > AddAbnormalProb[val] ? prevents[val] : AddAbnormalProb[val]; //状態異常付与が成功したとき if (CommonFunction.IsRandom(addabnormal[val]) == true) { //抵抗に成功したとき if (CommonFunction.IsRandom(prevents[val]) == true) { } else { int addstate = target.AddStateAbnormal(abnormal); if (addstate != 0) { abn += abnormal; //atinf.AddAbnormal(target, abnormal); atinf.AddMessage( CommonFunction.GetAbnormalMessage(val, target)); } } } } } if (abn != 0) { atinf.AddEffect(EffectBadSmoke.CreateObject(target)); atinf.AddAbnormal(target, abn); } } } //エフェクトをかける this.AttackEffect(target, attacker, damage.ToString(), AttackState.Hit, atinf); return(atState); } else { //外れた場合 atinf.AddHit(target, false); EffectDamage d = EffectDamage.CreateObject(target); d.SetText("Miss", AttackState.Miss); atinf.AddEffect(d); atinf.AddSound(GetAttackMissSound()); atinf.AddMessage( target.GetMessageAttackMiss()); return(AttackState.Miss); } }
public bool Invocate(ManageDungeon dun) { if (IsInvocation == false) { return(false); } IsActive = true; IsInvocation = false; int bresult; //オプションによるトラップ回避 float t = 0; foreach (BaseOption o in Target.Options) { t += o.DexTrap(); } if (CommonFunction.IsRandom(t) == true) { DisplayInformation.Info.AddMessage(CommonConst.Message.DexTrap); Target = null; return(false); } //スコア値の更新 DungeonHistoryInformation.Info.iTrapInvokeCount++; //サウンドを鳴らす if (Target.Type == ObjectType.Player) { VoiceInformation.Voice.Play(PlayerInformation.Info.PType, VoiceInformation.Voice.PlayRandomDefence()); } bool result = false; //効果発動 switch (TType) { case TrapType.Bomb: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Bomb); //エフェクトの発動 EffectBigBang.CreateObject(this).Play(); //ダメージ処理 int damage = Mathf.CeilToInt(Target.CurrentHp / PerPlayerDamage); AttackState atState = Target.AddDamage(damage); //プレイヤーが死亡したら if (atState == AttackState.Death) { DisplayInformation.Info.AddMessage( Target.GetMessageDeath(Target.HaveExperience)); ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Trap, DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Trap; Target.Death(); Target.DeathAction(dun); } //ダメージエフェクト EffectDamage d = EffectDamage.CreateObject(Target); d.SetText(damage.ToString(), AttackState.Hit); d.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( Target.GetMessageAttackHit(damage)); //周辺キャラのダメージ処理 dun.SetUpCharacterMap(); List <BaseCharacter> list = dun.GetNearCharacters(this.CurrentPoint, 1); foreach (BaseCharacter c in list) { atState = c.AddDamage(CommonNumber); EffectDamage d2 = EffectDamage.CreateObject(c); d2.SetText(CommonNumber.ToString(), AttackState.Hit); d2.Play(); //対象が死亡したら if (atState == AttackState.Death) { DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.DeathCommon, c.DisplayNameInMessage)); c.Death(); c.DeathAction(dun); } } result = true; break; case TrapType.ColorMonitor: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectColorMonitor.CreateObject(this).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.StiffShoulder); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.StiffShoulder, Target)); } result = true; break; case TrapType.Cyclone: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Cyclone); //エフェクトの発動 EffectCyclone.CreateObject(Target).Play(); //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCyclone2, Target.DisplayNameInMessage)); //効果 result = true; break; case TrapType.Electric: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.ElectricTrap); //エフェクトの発動 EffectThunder.CreateObject(Target).Play(); BaseItem[] equips = PlayerCharacter.ItemList.FindAll(i => i.IsEquip == true).ToArray(); if (equips.Length > 0) { foreach (BaseItem i in equips) { i.ForceRemoveEquip(Target); } DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapEquipRemove, Target.DisplayNameInMessage)); } result = true; break; case TrapType.Mud: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Slow); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Slow, Target)); } result = true; break; case TrapType.Palalysis: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Palalysis); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Palalysis, Target)); } result = true; break; case TrapType.Photo: if (Target.Type == ObjectType.Player) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCroquette2, Target.DisplayNameInMessage)); ((PlayerCharacter)Target).ReduceSatiety(CommonNumber); result = true; } break; case TrapType.Poison: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Poison); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Poison, Target)); } result = true; break; case TrapType.DeadlyPoison: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.DeadlyPoison); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.DeadlyPoison, Target)); } result = true; break; case TrapType.Rotation: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Rotation); //エフェクトの発動 EffectRotation.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Confusion); //対象が異常になったらメッセージを表示 if (bresult != 0) { EffectSmoke.CreateObject(Target); DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Confusion, Target)); } result = true; break; case TrapType.SandStorm: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Cyclone); //エフェクトの発動 EffectSandStorm.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Dark); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Dark, Target)); } result = true; break; case TrapType.Song: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Sleep); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Sleep, Target)); } result = true; break; case TrapType.Summon: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Summon); //エフェクトの発動 EffectSummon.CreateObject(Target).Play(); int cnt = CommonFunction.ConvergenceRandom(CountStart, ProbStart, ProbReduce); for (int i = 0; i < cnt; i++) { dun.SetUpCharacterMap(); //敵の出現地点を取得 MapPoint mp = dun.GetCharacterEmptyTarget(Target.CurrentPoint); if (CommonFunction.IsNull(mp) == true) { break; } int enemytype = TableEnemyMap.GetValue(dun.DungeonObjNo, DisplayInformation.Info.Floor); uint rand = CommonFunction.GetRandomUInt32(); BaseEnemyCharacter enemy = TableEnemyIncidence.GetEnemy(enemytype, rand, DisplayInformation.Info.Floor); enemy.SetCharacterDisplayObject(mp.X, mp.Y); dun.AddNewCharacter(enemy); } DisplayInformation.Info.AddMessage( CommonConst.Message.TrapSummon); result = true; break; case TrapType.TheFly: if (Target.Type == ObjectType.Player) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectBadSmoke.CreateObject(Target).Play(); BaseItem[] foods = PlayerCharacter.ItemList.FindAll(i => i.IType == ItemType.Food).ToArray(); if (foods.Length > 0) { foreach (BaseItem i in foods) { PlayerCharacter.RemoveItem(i); ((PlayerCharacter)Target).AddItem(TableFood.GetItem(CommonConst.ObjNo.FlyCroquette), i.SortNo); } //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapFly2)); } result = true; } break; case TrapType.WaterBucket: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.BucketFall); //エフェクトの発動 EffectWaterBucket.CreateObject(Target).Play(); //効果 bresult = Target.AddStateAbnormal((int)StateAbnormal.Reticent); //対象が異常になったらメッセージを表示 if (bresult != 0) { DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Reticent, Target)); } result = true; break; //花粉 case TrapType.Pollen: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); //エフェクトの発動 EffectSmoke d3 = EffectSmoke.CreateObject(Target); d3.SetColor(Color.yellow); d3.Play(); //力減少 Target.ReducePower((ushort)CommonNumber); //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapPllen2, Target.DisplayNameInMessage)); result = true; break; case TrapType.Ember: //ダメージ処理 int damage2 = CommonNumber; //通常ダメージの場合 if (CommonFunction.HasOptionType(this.Options, OptionType.ReverceDamage) == false) { AttackState atState2 = Target.AddDamage(damage2); //ダメージエフェクト EffectDamage d4 = EffectDamage.CreateObject(Target); d4.SetText(damage2.ToString(), AttackState.Hit); d4.Play(); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapDamage, Target.DisplayNameInMessage, this.DisplayNameInMessage, damage2)); //対象が死亡したら if (atState2 == AttackState.Death) { DisplayInformation.Info.AddMessage( Target.GetMessageDeath(Target.HaveExperience)); if (Target.Type == ObjectType.Player) { ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Trap, DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Trap; } Target.Death(); Target.DeathAction(dun); } } //反転回復の場合 else { Target.RecoverHp(damage2); //ダメージエフェクト EffectDamage d4 = EffectDamage.CreateObject(Target); d4.SetText(damage2.ToString(), AttackState.Heal); d4.Play(); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapRecover, Target.DisplayNameInMessage, this.DisplayNameInMessage, damage2)); } break; } Target = null; return(result); }
/// <summary> /// 奏でる /// </summary> public override bool Melody(ManageDungeon dun, PlayerCharacter player) { BaseCharacter[] targets; player.AttackInfo.Initialize(); //音を鳴らす player.AttackInfo.AddVoice(VoiceInformation.VoiceType.Sing); switch (MType) { //放電 case MelodyType.Electric: //サウンドを鳴らす player.AttackInfo.AddSound(SoundInformation.SoundType.ElectricMelody); const int ElectricDamage = 20; int damage = ElectricDamage + Mathf.FloorToInt(player.BaseAttack); //エフェクト player.AttackInfo.AddEffect(EffectSpark.CreateObject(player)); //メッセージ player.AttackInfo.AddMessage( string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); //部屋の中のキャラクターを取得 targets = dun.GetRoomCharacters(player); //全員にダメージ foreach (BaseCharacter c in targets) { AttackState atState = c.AddDamage(damage); //ダメージエフェクト EffectDamage d = EffectDamage.CreateObject(c); d.SetText(damage.ToString(), AttackState.Hit); player.AttackInfo.AddEffect(d); //ヒットメッセージ player.AttackInfo.AddMessage( c.GetMessageAttackHit(damage)); //対象が死亡したら if (atState == AttackState.Death) { player.AttackInfo.AddKillList(c); player.AttackInfo.AddMessage( c.GetMessageDeath(c.HaveExperience)); player.Death(c, player.AttackInfo); } } break; //狂乱 case MelodyType.Confusion: //サウンドを鳴らす player.AttackInfo.AddSound(SoundInformation.SoundType.Smoke); //メッセージ player.AttackInfo.AddMessage( string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); //部屋の中のキャラクターを取得 targets = dun.GetRoomCharacters(player); //全員を混乱 foreach (BaseCharacter c in targets) { //対象に混乱を付与 int result = c.AddStateAbnormal((int)StateAbnormal.Confusion); //対象が混乱になったらメッセージを表示 if (result != 0) { player.AttackInfo.AddEffect(EffectSmoke.CreateObject(c)); player.AttackInfo.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Confusion, c)); } } break; //まどろみ case MelodyType.Sleep: //サウンドを鳴らす player.AttackInfo.AddSound(SoundInformation.SoundType.Smoke); //メッセージ player.AttackInfo.AddMessage( string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); //部屋の中のキャラクターを取得 targets = dun.GetRoomCharacters(player); //全員を睡眠 foreach (BaseCharacter c in targets) { //対象に睡眠を付与 int result = c.AddStateAbnormal((int)StateAbnormal.Sleep); //対象が睡眠になったらメッセージを表示 if (result != 0) { player.AttackInfo.AddEffect(EffectSmoke.CreateObject(c)); player.AttackInfo.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Sleep, c)); } } break; //無秩序 case MelodyType.Anarchy: //サウンドを鳴らす player.AttackInfo.AddSound(SoundInformation.SoundType.Smoke); //メッセージ player.AttackInfo.AddMessage(string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); //部屋の中のキャラクターを取得 targets = dun.GetRoomCharacters(player); //全員をデコイ foreach (BaseCharacter c in targets) { //対象にデコイを付与 int result = c.AddStateAbnormal((int)StateAbnormal.Decoy); //対象がデコイになったらメッセージを表示 if (result != 0) { player.AttackInfo.AddEffect(EffectSmoke.CreateObject(c)); player.AttackInfo.AddMessage( CommonFunction.GetAbnormalMessage(StateAbnormal.Decoy, c)); } } break; //薄ら日 case MelodyType.Light: //エフェクト player.AttackInfo.AddEffect(EffectFlash.CreateObject()); //サウンドを鳴らす player.AttackInfo.AddSound(SoundInformation.SoundType.Smoke); //メッセージ player.AttackInfo.AddMessage(string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); dun.IsVisible = true; dun.IsEnemyVisible = true; dun.IsItemVisible = true; dun.IsTrapVisible = true; break; //角笛 case MelodyType.Horn: //サウンドを鳴らす player.AttackInfo.AddSound(SoundInformation.SoundType.Summon); //エフェクトの発動 player.AttackInfo.AddEffect(EffectSummon.CreateObject(player)); int cnt = CommonFunction.ConvergenceRandom(3, 0.9f, 1.2f, 10); for (int i = 0; i < cnt; i++) { dun.SetUpCharacterMap(); //敵の出現地点を取得 MapPoint mp = dun.GetCharacterEmptyTarget(player.CurrentPoint); if (CommonFunction.IsNull(mp) == true) { break; } int enemytype = TableEnemyMap.GetValue(dun.DungeonObjNo, DisplayInformation.Info.Floor); uint rand = CommonFunction.GetRandomUInt32(); BaseEnemyCharacter enemy = TableEnemyIncidence.GetEnemy(enemytype, rand, DisplayInformation.Info.Floor); enemy.SetCharacterDisplayObject(mp.X, mp.Y); dun.AddNewCharacter(enemy); } DisplayInformation.Info.AddMessage( CommonConst.Message.TrapSummon); break; // 忘却 case MelodyType.Forget: //メッセージ player.AttackInfo.AddMessage( string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); //効果音 player.AttackInfo.AddSound(SoundInformation.SoundType.Summon); if (dun.IsVisible == false) { for (int j = 1; j < dun.X - 1; j++) { for (int i = 1; i < dun.Y - 1; i++) { dun.Dungeon.DungeonMap.Get(i, j).IsClear = false; } } player.AttackInfo.AddMessage(CommonConst.Message.ForgetMap); player.AttackInfo.AddEffect(EffectSmoke.CreateObject(player)); } break; //捨て置き case MelodyType.ThrowAway: //メッセージ player.AttackInfo.AddMessage( string.Format(CommonConst.Message.MelodySing, DisplayNameInMessage)); player.AttackInfo.AddMessage( string.Format(CommonConst.Message.ThrowAway, player.DisplayNameInMessage)); GameStateInformation.Info.IsThrowAway = true; break; } return(true); }
/// <summary> /// 投げる効果(誰にも当たらなかったとき) /// </summary> public override bool ThrowDrop(ManageDungeon dun, PlayerCharacter player) { DisplayInformation.Info.AddMessage(string.Format(CommonConst.Message.BreakItem, this.DisplayNameInMessage)); IsThrowBreak = true; return(true); }
/// <summary> /// トラップ起動 /// </summary> public void Startup(ManageDungeon dun, BaseCharacter player) { IsVisible = true; IsInvocation = true; Target = player; //メッセージの出力 switch (TType) { case TrapType.Bomb: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapBigBang); break; case TrapType.ColorMonitor: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapColor); break; case TrapType.Cyclone: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapCyclone); break; case TrapType.Electric: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapElectric, player.DisplayNameInMessage)); break; case TrapType.Mud: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCommon, DisplayNameInMessage)); break; case TrapType.Palalysis: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapSmoke); break; case TrapType.Photo: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapCroquette); break; case TrapType.Poison: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCommon, DisplayNameInMessage)); break; case TrapType.DeadlyPoison: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCommon, DisplayNameInMessage)); break; case TrapType.Rotation: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCommon, DisplayNameInMessage)); break; case TrapType.SandStorm: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapSandStorm); break; case TrapType.Song: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapSong); break; case TrapType.Summon: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCommon, DisplayNameInMessage)); break; case TrapType.TheFly: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapFly); break; case TrapType.WaterBucket: //メッセージの出力 DisplayInformation.Info.AddMessage( CommonConst.Message.TrapWaterBucket); break; case TrapType.Pollen: //メッセージの出力 DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapPllen, player.DisplayNameInMessage)); break; } }
/// <summary> /// 食べる /// </summary> public override bool Use(ManageDungeon dun, BaseCharacter player) { switch (CType) { case CandyType.Energy: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Recover); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverPower)); player.RecoverPower(99); break; case CandyType.Handmaid: this.CommonUseItemCustom(dun, player, player); break; case CandyType.Bomb: List <BaseCharacter> list = dun.GetNearCharacters(player.CurrentPoint, 2, true); //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Bomb); //エフェクトの発動 EffectBigBang.CreateObject(player).Play(); //ダメージ処理 int damage = Mathf.CeilToInt(player.MaxHp / 2); if (damage > 50) { damage = 50; } foreach (BaseCharacter c in list) { AttackState atState = c.AddDamage(damage); EffectDamage d2 = EffectDamage.CreateObject(c); d2.SetText(damage.ToString(), AttackState.Hit); d2.Play(); //対象が死亡したら if (atState == AttackState.Death) { //プレイヤーが死亡したら if (c.Type == ObjectType.Player) { DisplayInformation.Info.AddMessage( player.GetMessageDeath(player.HaveExperience)); ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Trap, DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Trap; } else { DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.DeathCommon, c.DisplayNameInMessage)); } c.Death(); c.DeathAction(dun); } } break; case CandyType.Garlic: //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Recover); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.IncreaseHp)); player.MaxHpCorrection += 5; break; default: this.CommonUseItem(player); break; } return(true); }
public void TurnFInish(BaseCharacter target, ManageDungeon dun) { //ふたつの指輪だったら if (RType == RingType.TwoRing) { //毎ターンスコアを減額 ScoreInformation.Info.AddScore(-100); //キャラが正常だったら状態異常をランダム付与 if (target.CharacterAbnormalState == 0) { VoiceInformation.Voice.Play(PlayerInformation.Info.PType, VoiceInformation.Voice.PlayRandomDefence()); SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke); EffectSmoke.CreateObject(target).Play(); StateAbnormal st = CommonFunction.GetRandomAbnormal(); //switch (st) //{ // case StateAbnormal.Sleep: // DisplayInformation.Info.AddMessage( // string.Format(CommonConst.Message.AddSleep, target.DisplayNameInMessage)); // break; // case StateAbnormal.Slow: // DisplayInformation.Info.AddMessage( // string.Format(CommonConst.Message.AddSlow, target.DisplayNameInMessage)); // break; // case StateAbnormal.Dark: // DisplayInformation.Info.AddMessage( // string.Format(CommonConst.Message.AddDark, target.DisplayNameInMessage)); // break; // case StateAbnormal.StiffShoulder: // DisplayInformation.Info.AddMessage( // string.Format(CommonConst.Message.AddShoulder, target.DisplayNameInMessage)); // break; // default: // DisplayInformation.Info.AddMessage( // string.Format(CommonConst.Message.AddState, target.DisplayNameInMessage, // CommonFunction.StateNames[st])); // break; //} DisplayInformation.Info.AddMessage( CommonFunction.GetAbnormalMessage(st, target)); target.AddStateAbnormal(st); } } else if (RType == RingType.Unlucky) { if (CommonFunction.IsRandom(0.01f) == true) { //落とす対象を取得 BaseItem[] targets = PlayerCharacter.ItemList.FindAll(i => i.IsEquip == false && i.IsDrive == false).ToArray(); //対象があればランダムで落とす if (targets.Length > 0) { //対象の中からランダムで一つ抽出 BaseItem tar = targets[UnityEngine.Random.Range(0, targets.Length)]; DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.ThrowOffItem, target.DisplayNameInMessage, tar.DisplayNameInMessage )); //プレイヤーから持ち物削除 PlayerCharacter.RemoveItem(tar); dun.PutItem(tar, this.CurrentPoint, this.CurrentPoint); tar.ResetObjectPosition(); } } } }
public void AttackUpdate(BaseCharacter attaker, ManageDungeon dun) { if (this.IsUpdate == false) { return; } switch (this.BehType) { case BehaviorType.Attack: foreach (BaseCharacter c in this.Targets) { //攻撃の命中判定 if (this.IsHit[c.Name] == true) { //オプションの攻撃効果 foreach (BaseOption op in attaker.Options) { op.DamageAttackEffect(attaker, c, this.Damages[c.Name]); } //オプションの防御効果 foreach (BaseOption op in c.Options) { op.DamageDefenceEffect(attaker, c, this.Damages[c.Name]); } } } break; } //対象が死亡したら foreach (BaseCharacter c in this.KillList) { //対象の死亡アニメーションを実行 c.DeathAction(dun); } //エフェクトの実行 foreach (EffectBase e in this.Effects) { e.Play(); } //サウンドの実行 foreach (SoundInformation.SoundType s in this.Sounds) { SoundInformation.Sound.Play(s); } //ボイスの実行 foreach (VoiceInformation.VoiceType v in this.Voices) { VoiceInformation.Voice.Play(this.VoiceType, v); } //メッセージの追加 foreach (string s in this.Messages) { DisplayInformation.Info.AddMessage(s); } this.Clear(); }
/// <summary> /// 奏でる /// </summary> public virtual bool Melody(ManageDungeon dun, PlayerCharacter player) { return(true); }
/// <summary> /// 使う全般 /// </summary> public bool CommonUseItemCustom(ManageDungeon dun, BaseCharacter center, BaseCharacter player) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.Recover); //範囲拡大がついているとき int plus; float cf; int dist = 0; if (CommonFunction.HasOptionType(this.Options, OptionType.Wildfire, out plus, out cf) == true) { dist = plus; } dun.SetUpCharacterMap(); List <BaseCharacter> targets = dun.GetNearCharacters(center.CurrentPoint, dist, true); foreach (BaseCharacter target in targets) { //満腹度の回復 if (SatRecoverPoint > 0) { if (typeof(PlayerCharacter) == target.GetType()) { float satRecoverPoint = SatRecoverPoint; //効果増幅があったら if (CommonFunction.HasOptionType(this.Options, OptionType.EffectUp, out plus, out cf) == true) { satRecoverPoint = satRecoverPoint + plus * cf; } if (CommonFunction.HasOptionType(this.Options, OptionType.EffectDown, out plus, out cf) == true) { satRecoverPoint = satRecoverPoint - plus * cf; } //ダメージ増減30% float rand = 0.3f; if (CommonFunction.HasOptionType(this.Options, OptionType.EffectStabile, out plus, out cf) == true) { rand -= cf * plus; } else if (CommonFunction.HasOptionType(this.Options, OptionType.EffectNotStabile, out plus, out cf) == true) { rand += cf * plus; } satRecoverPoint += Mathf.CeilToInt(UnityEngine.Random.Range(-rand * satRecoverPoint, rand * satRecoverPoint)); //減少判定の時 if (CommonFunction.HasOptionType(this.Options, OptionType.ReverceDamage) == true) { ((PlayerCharacter)target).ReduceSatiety(satRecoverPoint); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.TrapCroquette2, target.DisplayNameInMessage)); } //通常回復判定のとき else { ((PlayerCharacter)target).AddSatiety(satRecoverPoint); if (((PlayerCharacter)target).IsSatietyMax == true) { DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverSatietyMax)); } else { DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverSatiety)); } } } } //HPの回復 if (HpRecoverPoint > 0) { //ダメージ追加 int damage = Mathf.FloorToInt(HpRecoverPoint / (center.CurrentPoint.DistanceAbs(target.CurrentPoint) + 1)); //効果増幅があったら if (CommonFunction.HasOptionType(this.Options, OptionType.EffectUp, out plus, out cf) == true) { damage = damage + plus * (int)cf; } if (CommonFunction.HasOptionType(this.Options, OptionType.EffectDown, out plus, out cf) == true) { damage = damage - plus * (int)cf; } //ダメージ増減30% float rand = 0.3f; if (CommonFunction.HasOptionType(this.Options, OptionType.EffectStabile, out plus, out cf) == true) { rand -= cf * plus; } else if (CommonFunction.HasOptionType(this.Options, OptionType.EffectNotStabile, out plus, out cf) == true) { rand += cf * plus; } damage += Mathf.CeilToInt(UnityEngine.Random.Range(-rand * damage, rand * damage)); //減少判定の時 if (CommonFunction.HasOptionType(this.Options, OptionType.ReverceDamage) == true) { AttackState atState = target.AddDamage(damage); //ダメージエフェクト EffectDamage d = EffectDamage.CreateObject(target); d.SetText(damage.ToString(), AttackState.Hit); d.Play(); //ヒットメッセージ DisplayInformation.Info.AddMessage( target.GetMessageAttackHit(damage)); //対象が死亡したら if (atState == AttackState.Death) { DisplayInformation.Info.AddMessage( target.GetMessageDeath(target.HaveExperience)); if (target.Type == ObjectType.Player) { ScoreInformation.Info.CauseDeath = string.Format(CommonConst.DeathMessage.Item, this.DisplayNameNormal); ScoreInformation.Info.CauseDeathType = DeathCouseType.Item; target.Death(); } else { player.Death(target, player.AttackInfo); } target.DeathAction(dun); } } //通常回復判定のとき else { target.RecoverHp(HpRecoverPoint); DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverHp, target.DisplayNameInMessage)); //回復エフェクト EffectDamage d = EffectDamage.CreateObject(target); d.SetText(HpRecoverPoint.ToString(), AttackState.Heal); d.Play(); } } //Power回復 if (CommonFunction.HasOptionType(this.Options, OptionType.RecoverPower) == true) { if (target.RecoverPowerNotMaxup(1) == true) { DisplayInformation.Info.AddMessage( string.Format(CommonConst.Message.RecoverPower, target.DisplayNameInMessage)); } } } //状態異常の付与 EffectAbnormal(targets); return(true); }
/// <summary> /// 使う /// </summary> public virtual bool Use(ManageDungeon dun, BaseCharacter player) { return(true); }
public override bool Move(ManageDungeon dun, bool isNextAttack, out bool isSpecial, MapPoint plcurrent) { isSpecial = false; return(false); }