コード例 #1
0
ファイル: GameCharacter.cs プロジェクト: v5100v5100/UnityRPG
        public void AddActiveEffect(ActiveEffect a, BattleGame game)
        {
            ActivateEffect(a, game);

            a.duration--;
            if (a.duration > 0)
            {
                game.battleLog.AddEntry(string.Format("{0} was added to {1}.", a.name, this.name));

                activeEffects.Add(a);
            }
        }
コード例 #2
0
ファイル: GameCharacter.cs プロジェクト: v5100v5100/UnityRPG
        private void ActivateEffect(ActiveEffect effect, BattleGame game)
        {
            int amt = 0;

            switch (effect.statType)
            {
            case StatType.Damage:
                amt = game.r.Next(effect.minAmount, effect.maxAmount);

                game.battleLog.AddEntry(string.Format("{0} was damaged by {1} for {2}", this.name, effect.name, amt.ToString()));

                game.gameControllerScript.StartTempTextOnChar(this, amt, true);


                this.Damage(amt, game);
                break;

            case StatType.Heal:
                amt = game.r.Next(effect.minAmount, effect.maxAmount);
                game.battleLog.AddEntry(string.Format("{0} was healed by {1} for {2}", this.name, effect.name, amt.ToString()));

                game.gameControllerScript.StartTempTextOnChar(this, amt, false);


                this.Heal(amt, game);
                break;

            case StatType.Dispell:

                amt = game.r.Next(effect.minAmount, effect.maxAmount);
                game.battleLog.AddEntry(string.Format("{0} removed {1} effects from {2}", effect.name, amt, this.name));

                RemoveTopActiveEffects(amt);
                break;

            default:
                break;
            }
        }
コード例 #3
0
ファイル: GameCharacter.cs プロジェクト: mengtest/UnityRPG
        private void ActivateEffect(ActiveEffect effect, BattleGame game)
        {
            int amt = 0;
            switch (effect.statType)
            {
                case StatType.Damage:
                     amt = game.r.Next(effect.minAmount, effect.maxAmount);

                    game.battleLog.AddEntry(string.Format("{0} was damaged by {1} for {2}", this.name, effect.name, amt.ToString()));

                    game.gameControllerScript.StartTempTextOnChar(this, amt, true);


                    this.Damage(amt, game);
                    break;
                case StatType.Heal:
                     amt = game.r.Next(effect.minAmount, effect.maxAmount);
                     game.battleLog.AddEntry(string.Format("{0} was healed by {1} for {2}", this.name, effect.name, amt.ToString()));

                     game.gameControllerScript.StartTempTextOnChar(this, amt, false);


                    this.Heal(amt, game);
                    break;
                case StatType.Dispell:

                    amt = game.r.Next(effect.minAmount, effect.maxAmount);
                    game.battleLog.AddEntry(string.Format("{0} removed {1} effects from {2}", effect.name, amt, this.name));

                    RemoveTopActiveEffects(amt);
                    break;
                default:
                    break;
            }
        }
コード例 #4
0
ファイル: GameCharacter.cs プロジェクト: mengtest/UnityRPG
        public void AddActiveEffect(ActiveEffect a, BattleGame game)
        {
            ActivateEffect(a, game);

            a.duration--;
            if (a.duration > 0)
            {
                game.battleLog.AddEntry(string.Format("{0} was added to {1}.", a.name, this.name));

                activeEffects.Add(a);
            }
        }
コード例 #5
0
 public static ActiveEffect cloneActiveEffect(ActiveEffect ae)
 {
     return(ae);
     // return JsonConvert.DeserializeObject<ActiveEffect>(JsonConvert.SerializeObject(ae));
 }
コード例 #6
0
ファイル: AbilityHelper.cs プロジェクト: mengtest/UnityRPG
 public static ActiveEffect cloneActiveEffect(ActiveEffect ae)
 {
     return ae;
    // return JsonConvert.DeserializeObject<ActiveEffect>(JsonConvert.SerializeObject(ae));
 }