Beispiel #1
0
 public IEnumerator ShowEaterMenuRoutine(Unit dropper)
 {
     eaterSelector.gameObject.SetActive(true);
     eaterView.Populate(Global.Instance().Party, (obj, unit) => {
         obj.GetComponent <EaterCell>().Populate(unit, MonsterFamily.GetTransformResult(unit, dropper));
     });
     eaterSelector.gameObject.SetActive(true);
     yield return(null);
 }
Beispiel #2
0
        public void AuraStacksTest()
        {
            // Setup
            Monster actor  = new Monster();
            Monster target = new Monster();

            // Test Aura Buff damage bonus
            foreach (int i in Enum.GetValues(typeof(MonsterFamily)))
            {
                MonsterFamily fam = (MonsterFamily)i;

                int minDmg = actor.Strength;
                int maxDmg = actor.Strength * 3;

                target.Families.Add(fam);
                testDamageRange(actor, target, minDmg, maxDmg);
                actor.AddBuff(Buff.Aura, i + 1);

                // NES Bug. Aura buff ignores undead, and therefore applies no bonus damage.
                // Check this, flip the flag, then ensure it works properly if fixed
                Globals.BUG_FIXES = false;
                if (!Globals.BUG_FIXES && fam == MonsterFamily.Undead)
                {
                    testDamageRange(actor, target, minDmg, maxDmg);
                    Globals.BUG_FIXES = true;
                }

                testDamageRange(actor, target, minDmg + 20, maxDmg + 60);
                target.Families.Remove(fam);
                testDamageRange(actor, target, minDmg, maxDmg);
                actor.RemoveBuff(Buff.Aura);
            }

            // Ensure Aura bonus damage doesn't stack
            target.Families.Add(MonsterFamily.Air);
            target.Families.Add(MonsterFamily.Dragon);
            target.Families.Add(MonsterFamily.Earth);
            testDamageRange(actor, target, actor.Strength, actor.Strength * 3);
            actor.AddBuff(Buff.Aura, 1);
            testDamageRange(actor, target, actor.Strength + 20, (actor.Strength * 3) + 60);
            actor.AddBuff(Buff.Aura, 7);
            testDamageRange(actor, target, actor.Strength + 20, (actor.Strength * 3) + 60);
            target.Families.Clear();
            actor.RemoveBuff(Buff.Aura);
        }
Beispiel #3
0
    private async Task <bool> DoMeatAsync()
    {
        var roll   = UnityEngine.Random.Range(0, 100);
        var offset = 0;

        if (Enemy.Size > 1)
        {
            offset = UnityEngine.Random.Range(0, Enemy.Size);
        }
        Unit dropper = null;

        for (var i = 0; i < Enemy.Groups.Count; i += 1)
        {
            var index = (i + offset) % Enemy.Groups.Count;
            if (roll < Enemy[index].MeatDropChance)
            {
                dropper = Enemy[index];
                break;
            }
        }
        if (dropper == null)
        {
            return(false);
        }

        await WriteLineAsync("");
        await WriteLineAsync("");
        await WriteLineAsync("Found meat of " + dropper.Name + ".");

        await View.ShowEatYesNoMenuRoutine();

        var command = await View.eatYesNoSelector.SelectCommandAsync();

        await View.HideEatYesNoRoutine();

        if (command != "EAT")
        {
            return(false);
        }

        await View.ShowEaterMenuRoutine(dropper);

        var selection = await View.eaterSelector.SelectItemAsync();

        await View.HideEaterMenuRoutine();

        if (selection < 0)
        {
            return(false);
        }

        var eater = Player[selection];

        if (eater == null)
        {
            return(false);
        }

        CharaData newForm = MonsterFamily.GetTransformResult(eater, dropper);

        if (newForm != null)
        {
            await WriteLineAsync(eater.Name + " transformed into " + newForm.species + ".");

            MonsterFamily.TransformEater(eater, dropper);
        }
        else
        {
            await WriteLineAsync("Nothing happened.");
        }
        await Global.Instance().Input.ConfirmRoutine();

        return(true);
    }