コード例 #1
0
ファイル: Debuff.cs プロジェクト: EuropeanSnail/DungeonTycoon
 public override void InitSkill()
 {
     //SetNameAndExplanation("균열", "적을 공격할 때마다 방어력을 6% 감소시키는 디버프를 남깁니다. 디버프는 최대 5번까지 중첩되며 2초간 지속됩니다.");
     defDebuff = new TemporaryEffect(skillName, 2, STACK_LIMIT);
     defMod    = new StatModContinuous(StatType.Defence, ModType.Mult, DEF_PENALTY_RATE);
     defDebuff.AddContinuousMod(defMod);
 }
コード例 #2
0
    public virtual void calculateSpeed()
    {
        float scale = 1f;

        for (int a = 0; a < tempEffects.Count; ++a)
        {
            TemporaryEffect tempEffect = (TemporaryEffect)tempEffects[a];
            switch (tempEffect.type)
            {
            case 552:
                scale *= 0.5f;
                break;

            case 555:
                scale *= 0.5f;
                break;

            case 556:
                scale *= 0.5f;
                break;

            case 557:
                scale *= 0f;
                break;

            default:
                break;
            }
        }
        if (status.canBeCCed == false)
        {
            scale = 1f;
        }
        status.moveSpeed = status.regularMoveSpeed * scale;
    }
コード例 #3
0
 protected void Update()
 {
     if (Time.timeScale == 0)
     {
         return;
     }
     if (status.hp <= 0f)
     {
         die();
         return;
     }
     for (int a = 0; a != 10; ++a)
     {
         if (actionCdRemain[a] > 0)
         {
             actionCdRemain[a] -= Time.deltaTime;
         }
         if (actionCdRemain[a] <= 0)
         {
             actionCdRemain[a] = 0;
         }
     }
     calculateSpeed();
     calculateDot();
     for (int a = 0; a < tempEffects.Count; ++a)
     {
         TemporaryEffect tempEffect = (TemporaryEffect)tempEffects[a];
         tempEffect.remainTime -= Time.deltaTime;
         if (tempEffect.remainTime <= 0f)
         {
             tempEffects.Remove(tempEffect);
         }
     }
 }
コード例 #4
0
    public TemporaryEffect(TemporaryEffect tempEffect)
    {
        continuousMods = new List <StatModContinuous>();
        discreteMods   = new List <StatModDiscrete>();

        name       = tempEffect.name;
        duration   = tempEffect.duration;
        stackLimit = tempEffect.stackLimit;
        stackCnt   = 1;
        ResetTimer();

        subject           = tempEffect.subject;
        subjectBattleStat = tempEffect.subjectBattleStat;

        foreach (StatModContinuous statMod in tempEffect.continuousMods)
        {
            continuousMods.Add(new StatModContinuous(statMod));
        }
        foreach (StatModDiscrete statMod in tempEffect.discreteMods)
        {
            discreteMods.Add(new StatModDiscrete(statMod));
        }

        //Debug.Log("StatType: " + continuousMods[0].StatType + ", Value: " + continuousMods[0].ModValue);
    }
コード例 #5
0
ファイル: TemporaryEffect.cs プロジェクト: Graysire/TACOM
 //copy constructor
 public TemporaryEffect(TemporaryEffect other)
 {
     name      = other.name;
     attribute = other.attribute;
     power     = other.power;
     duration  = other.duration;
 }
コード例 #6
0
 public HanaUniqueSkill()
 {
     totalDmg = 0;
     //SetCoverage();
     defDebuff = new TemporaryEffect("감전", DURATION);
     defDebuff.AddContinuousMod(new StatModContinuous(StatType.Defence, ModType.Mult, DEBUFF_RATE));
     ///defDebuff.AddContinuousMod(new StatModContinuous(StatType.Defence, ModType.Fixed, 10.0f));
 }
コード例 #7
0
    public override void OnAttack(float actualDamage, bool isCrit, bool isDodged)
    {
        TemporaryEffect shieldBuff = new TemporaryEffect(skillName, DURATION);

        shieldBuff.AddContinuousMod(new StatModContinuous(StatType.Shield, ModType.Fixed, actualDamage * SHIELD_RATE));
        owner.AddTemporaryEffect(shieldBuff);
        DisplaySkillEffect();
    }
コード例 #8
0
    public override void InitSkill()
    {
        //SetNameAndExplanation("벼락", "적을 공격할 때 치명타가 발생하면, 60의 추가 피해를 주고 적의 방어력을 10 감소시키는 디버프를 남깁니다. 디버프는 3초간 지속됩니다.");
        defDebuff = new TemporaryEffect("저릿저릿", DURATION);
        defDebuff.AddContinuousMod(new StatModContinuous(StatType.Defence, ModType.Fixed, DEF_DEBUFF_VALUE));

        skillEffect = Instantiate((GameObject)Resources.Load("EffectPrefabs/HanaNorm_SkillEffect"));
        skillEffect.transform.SetParent(owner.GetTransform());
    }
コード例 #9
0
ファイル: TemporaryEffect.cs プロジェクト: Graysire/TACOM
    //adds a copy of this effect to the target with a powerApplied of finalPower
    protected override void AddCopy(ref CharacterTargetInfo targetInfo, int finalPower)
    {
        TemporaryEffect temp = new TemporaryEffect(this)
        {
            powerApplied = finalPower
        };

        targetInfo.target.AddEffect(temp);
        targetInfo.target.OnTick += temp.TickEffect;
    }
コード例 #10
0
 public virtual void removeTemporaryEffect(int type)
 {
     for (int a = 0; a < tempEffects.Count; ++a)
     {
         TemporaryEffect tempEffect = (TemporaryEffect)tempEffects[a];
         if (tempEffect.type == type)
         {
             tempEffects.Remove(tempEffect);
         }
     }
 }
コード例 #11
0
    /// <summary>
    /// 일시적 효과 삭제
    /// </summary>
    /// <param name="toBeRemoved"></param>
    public void RemoveTemporaryEffect(TemporaryEffect toBeRemoved)
    {
        if (temporaryEffects.ContainsKey(toBeRemoved.name))
        {
            toBeRemoved.ResetTimer(); // 재활용할 수 있으니 리셋.
            toBeRemoved.ResetStack(); // 스택도 여기서 리셋

            toBeRemoved.RemoveEffect();
            temporaryEffects.Remove(toBeRemoved.name);
        }
    }
コード例 #12
0
    public override void InitSkill()
    {
        //SetNameAndExplanation("신의 가호", "매 1초마다, 주위 1칸 내의 모든 적에게 12만큼의 피해를 주고 방어력을 15 감소시키는 디버프를 남깁니다. 피해는 적의 방어력을 무시하며, 디버프는 2초 동안 지속됩니다.");
        //SetCoverage();
        SetMyBattleStat();
        defDebuff = new TemporaryEffect("눈부심", DURATION);
        defDebuff.AddContinuousMod(new StatModContinuous(StatType.Defence, ModType.Fixed, DEF_PENALTY));

        skillEffect = Instantiate((GameObject)Resources.Load("EffectPrefabs/DivineProtection_SkillEffect"));
        skillEffect.transform.SetParent(owner.GetTransform());
        skillEffect.transform.position = owner.GetPosition() + new Vector3(0, -0.11f, 0);
    }
コード例 #13
0
 /// <summary>
 /// 일시적 효과 추가
 /// </summary>
 /// <param name="toBeAdded"></param>
 public void AddTemporaryEffect(TemporaryEffect toBeAdded)
 {
     if (!temporaryEffects.ContainsKey(toBeAdded.name))
     {
         temporaryEffects.Add(toBeAdded.name, toBeAdded);
         toBeAdded.SetSubject(this);
         toBeAdded.ApplyEffect();
     }
     else
     {
         toBeAdded.StackUp();
     }
 }
コード例 #14
0
    public TemporaryEffectData(TemporaryEffect tempEffect)
    {
        continuousMods = tempEffect.GetContinousModList();
        discreteMods   = tempEffect.GetDiscreteModList();

        stackCnt   = tempEffect.GetStackCnt();
        stackLimit = tempEffect.GetStackLimit();

        name = tempEffect.name;

        duration    = tempEffect.duration;
        elapsedTime = tempEffect.elapsedTime;
    }
コード例 #15
0
ファイル: Skill.cs プロジェクト: EuropeanSnail/DungeonTycoon
 public void ApplyTemporaryEffect(List <ICombatant> targets, TemporaryEffect effect, bool toHostile, bool createNew = true)
 {
     foreach (ICombatant target in targets)
     {
         if (toHostile && IsHostile(target))
         {
             ApplyTemporaryEffect(target, effect, createNew);
         }
         else if (!toHostile && !IsHostile(target))
         {
             ApplyTemporaryEffect(target, effect, createNew);
         }
     }
 }
コード例 #16
0
ファイル: Skill.cs プロジェクト: EuropeanSnail/DungeonTycoon
    /// <summary>
    /// 대상에게 버프 or 디버프를 적용
    /// </summary>
    /// <param name="target">대상</param>
    /// <param name="effect">버프나 디버프의 프로토타입</param>
    /// <param name="createNew">전달된 그대로 적용할 건지, 새 개체를 생성해서 적용할 건지. 중첩가능한 스킬은 false</param>
    public void ApplyTemporaryEffect(ICombatant target, TemporaryEffect effect, bool createNew = true)
    {
#if DEBUG_TEMP_EFFECT
        Debug.Log("적: " + target);
#endif
        if (createNew)
        {
            target.AddTemporaryEffect(new TemporaryEffect(effect));
        }
        else
        {
            target.AddTemporaryEffect(effect);
        }
    }
コード例 #17
0
    public override void InitSkill()
    {
        //SetNameAndExplanation("힘 흡수", "주위 1칸 내의 모든 적 공격력의 10%를 흡수합니다.");
        SetMyBattleStat();

        siphonStrengthDebuff = new TemporaryEffect("빠져나간 힘", DURATION);

        siphonStrengthBuff = new TemporaryEffect("흡수한 힘", DURATION);
        atkMod             = new StatModContinuous(StatType.Attack, ModType.Fixed, 0.0f);
        siphonStrengthBuff.AddContinuousMod(atkMod);

        skillEffect = Instantiate((GameObject)Resources.Load("EffectPrefabs/SiphonStrength_SkillEffect"));
        skillEffect.transform.SetParent(owner.GetTransform());
        skillEffect.transform.position = owner.GetPosition() + new Vector3(0, -0.11f, 0);
        //SetCoverage();
    }
コード例 #18
0
    public override void InitSkill()
    {
        myBattleStat = owner.GetBattleStat();
        shieldMod    = new StatModContinuous(StatType.Shield, ModType.Fixed, 0);
        shieldBuff   = new TemporaryEffect("파비스", DURATION);
        shieldBuff.AddContinuousMod(shieldMod);

        atkMod    = new StatModContinuous(StatType.Attack, ModType.Mult, ATK_BONUS_RATE);
        atkSpdMod = new StatModContinuous(StatType.AttackSpeed, ModType.Mult, ATKSPD_PENALTY_RATE);

        skillEffect = Instantiate((GameObject)Resources.Load("EffectPrefabs/ShieldGaining_BuffEffect"));
        skillEffect.transform.SetParent(owner.GetTransform());
        skillEffect.transform.position = owner.GetPosition();

        //SetNameAndExplanation("파비스 석궁병", "공격력이 40% 증가하는 대신 공격속도가 33% 감소합니다. 매 사격마다 최대체력의 3%에 해당하는 방어막을 얻습니다. 방어막은 중첩되지 않습니다.");
    }
コード例 #19
0
    public virtual void applyTemporaryEffect(int type)
    {
        if (type < 500)
        {
            return;
        }
        foreach (TemporaryEffect t in tempEffects)
        {
            if (t.type == type)
            {
                return;
            }
        }
        TemporaryEffect tempEffect = new TemporaryEffect(type);

        tempEffects.Add(tempEffect);
    }
コード例 #20
0
    public virtual void calculateDot()
    {
        for (int a = 0; a < tempEffects.Count; ++a)
        {
            TemporaryEffect tempEffect = (TemporaryEffect)tempEffects[a];
            switch (tempEffect.type)
            {
            case 550:
                if (tempEffect.dotTimeout())
                {
                    status.hp -= 5f;
                }
                break;

            default:
                break;
            }
        }
    }
コード例 #21
0
    private float SiphonFromArea()
    {
        float totalSiphonedAtk = 0;

        foreach (ICombatant target in targets)
        {
            if (IsHostile(target))
            {
                float siphonedAtk = target.GetBattleStat().Attack *SIPHON_RATE;
                totalSiphonedAtk += siphonedAtk;
                TemporaryEffect temp = new TemporaryEffect(siphonStrengthDebuff);
                temp.AddContinuousMod(new StatModContinuous(StatType.Attack, ModType.Fixed, siphonedAtk * -1));

                ApplyTemporaryEffect(target, temp, false);
            }
        }

        return(totalSiphonedAtk);
    }
コード例 #22
0
ファイル: Tester.cs プロジェクト: Graysire/TACOM
    // Start is called before the first frame update
    void Start()
    {
        int[] att = { 9, 9, 9, 9, 9, 9, 4, 100, 6 };
        //tests Immediate Effects
        AbilitySets[] abil = { AbilitySets.GOSPEL_Rifle };

        Character       c  = new Character("Test Character 1", att, abil);
        Character       c2 = new Character("Test Character 2", att, abil);
        ImmediateEffect e  = new ImmediateEffect("TestImmediateEffect-20", CharacterAttributes.Health, 20, CharacterAttributes.Perception);
        Ability         a  = new Ability("TestAbilityImmediate", e, CharacterAttributes.Perception, CharacterAttributes.Defense, 5);

        c.UseAbility(a, 0, new CharacterTargetInfo(c, c2));

        //tests Removable Effects
        RemovableEffect e1 = new RemovableEffect("TestRemovableEffect-40", CharacterAttributes.Health, 40, CharacterAttributes.Perception);
        Ability         a2 = new Ability("TestAbilityRemovable", e1, CharacterAttributes.Perception, CharacterAttributes.Defense, 5);

        c.UseAbility(a2, 0, new CharacterTargetInfo(c, c2));
        //e1.RemoveEffect(new CharacterTargetInfo(c2, c2));

        //tests Temporary Effects
        TemporaryEffect e2 = new TemporaryEffect("TestTemporaryEffect-60", CharacterAttributes.Health, 60, CharacterAttributes.Perception, 2);
        Ability         a3 = new Ability("TestAbilityTemporary", e2, CharacterAttributes.Perception, CharacterAttributes.Defense, 5);

        c.UseAbility(a3, 0, new CharacterTargetInfo(c, c2));
        c2.TickCharacter();
        c2.TickCharacter();

        //tests Periodic Temporary Effects
        ImmediateEffect[]       eff = { e };
        PeriodicTemporaryEffect e3  = new PeriodicTemporaryEffect("TestPeriodicEffect-20", CharacterAttributes.Health, 20, 2, 1, eff, true);
        Ability a4 = new Ability("TestAbilityPeriodic", e3, CharacterAttributes.Perception, CharacterAttributes.Defense, 5);

        c.UseAbility(a4, 0, new CharacterTargetInfo(c, c2));
        c2.TickCharacter();
        c2.TickCharacter();
        c2.TickCharacter();
    }
コード例 #23
0
 public override void InitSkill()
 {
     //SetNameAndExplanation("몰입", "전투 시작 후 1초가 지날 때마다 공격속도가 5% 증가하는 버프를 얻습니다. 버프는 최대 5번까지 중첩되며, 2초간 지속됩니다.");
     atkspdBuff = new TemporaryEffect(skillName, DURATION, STACK_LIMIT);
     atkspdBuff.AddContinuousMod(new StatModContinuous(StatType.AttackSpeed, ModType.Mult, ATKSPD_BONUS_RATE));
 }
コード例 #24
0
	public virtual void applyTemporaryEffect(int type) {
		if(type <500)return;
		foreach (TemporaryEffect t in tempEffects) {
			if(t.type == type)return;
		}
		TemporaryEffect tempEffect = new TemporaryEffect(type);
		tempEffects.Add(tempEffect);
	}