public static EffectShieldThrow CreateObject(BaseCharacter target, BaseCharacter attacker, string damage, AttackState at)
    {
        //var obj = GameObject.Instantiate(ResourceInformation.Effect.transform.FindChild("Stone").gameObject);
        //obj.transform.SetParent(ResourceInformation.Effect.transform, false);
        //EffectStoneThrow d = obj.AddComponent<EffectStoneThrow>();
        //d.Parent = obj;
        EffectShieldThrow d = GetGameObject <EffectShieldThrow>(false, "EffectShield", ResourceInformation.Effect.transform);

        d.Direction = attacker.Direction;
        d.isDirect  = true;
        d.wait      = 5;

        d.eDamage = EffectDamage.CreateObject(target);
        d.eDamage.SetText(damage, at);

        //目標位置の取得
        d.TargetPoint = new Vector3(target.CurrentPoint.X * target.PositionUnit,
                                    attacker.PosY,
                                    target.CurrentPoint.Y * target.PositionUnit);

        //現在位置の取得
        Vector3 v = new Vector3(attacker.CurrentPoint.X * attacker.PositionUnit,
                                attacker.PosY,
                                attacker.CurrentPoint.Y * attacker.PositionUnit);

        //戻り位置の取得
        d.ReturnPoint = new Vector3(attacker.CurrentPoint.X * attacker.PositionUnit,
                                    attacker.PosY,
                                    attacker.CurrentPoint.Y * attacker.PositionUnit);


        d.Parent.transform.localPosition = v;

        return(d);
    }
예제 #2
0
    /// <summary>
    /// 投げる開始
    /// </summary>
    public override bool ThrowStartSpecial(PlayerCharacter player, BaseCharacter target)
    {
        //隕鉄の盾だったら一定の確率で戻ってくる
        if (ApType == ShieldAppearanceType.Stars)
        {
            if (CommonFunction.IsRandom(0.95f) == true)
            {
                int         damage  = Mathf.CeilToInt(ItemDefence / 2);
                AttackState atState = CommonFunction.AddDamage(player.AttackInfo, player, target, damage);

                player.AttackInfo.AddMessage(string.Format(CommonConst.Message.ThrowAction, this.DisplayNameInMessage));

                //対象が死亡したら
                if (atState == AttackState.Death)
                {
                    player.AttackInfo.AddKillList(target);

                    player.AttackInfo.AddMessage(
                        target.GetMessageDeath(target.HaveExperience));

                    player.Death(target, player.AttackInfo);
                }

                EffectShieldThrow.CreateObject(target, player, damage.ToString(), AttackState.Hit).Play();
                return(true);
            }
            else
            {
                return(false);
            }
        }
        return(false);
    }