Ejemplo n.º 1
0
    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);
        }
    }