Ejemplo n.º 1
0
    IEnumerator SelfEffect(UnitInfo self, string[] effects, int[] duration)
    {
        Dictionary <string, int> currentStatus = self.status;

        for (int i = 0; i < effects.Length; i++)
        {
            if (effects[i].Contains("HP"))
            {
                self.statMods[0] += Int32.Parse(effects[i].Substring(2));
                self.modDur[0]    = duration[i];
            }
            else if (effects[i].Contains("MP"))
            {
                self.statMods[1] += Int32.Parse(effects[i].Substring(2));
                self.modDur[1]    = duration[i];
            }
            else if (effects[i].Contains("swords"))
            {
                self.statMods[2] += Int32.Parse(effects[i].Substring(6));
                self.modDur[2]    = duration[i];
            }
            else if (effects[i].Contains("cups"))
            {
                self.statMods[3] += Int32.Parse(effects[i].Substring(4));
                self.modDur[3]    = duration[i];
            }
            else if (effects[i].Contains("wands"))
            {
                self.statMods[4] += Int32.Parse(effects[i].Substring(5));
                self.modDur[4]    = duration[i];
            }
            else if (effects[i].Contains("pent"))
            {
                self.statMods[5] += Int32.Parse(effects[i].Substring(4));
                self.modDur[5]    = duration[i];
            }
            else if (effects[i].Contains("move"))
            {
                self.statMods[6] += Int32.Parse(effects[i].Substring(4));
                self.modDur[6]    = duration[i];
            }
            else if (effects[i] == "bloodinversion")
            {
                int amt = self.currHP - 1;
                self.currHP  = 1;
                self.currMP += amt;
                currentStatus.Add("bloodinversion", 3);
            }
            else if (effects[i] == "chakraswap")
            {
                int hold = self.currHP;
                self.currHP = self.currMP;
                self.currMP = hold;
            }
            else if (effects[i] == "MPRegen")
            {
                self.MPRegen();
            }
            else if (effects[i] == "dispel")
            {
                currentStatus.Clear();
            }
            else if (effects[i] == "widen")
            {
                if (currentStatus.ContainsKey("widen"))
                {
                    currentStatus.Remove("widen");
                }
                else
                {
                    currentStatus.Add("widen", 1);
                }
            }
            else
            {
                string name = effects[i];
                currentStatus.Add(name, duration[i]);
            }
        }

        self.status = currentStatus;


        yield return(new WaitForSeconds(0.0f));
    }