Ejemplo n.º 1
0
        static void Main()
        {
            Bear    GrizzlyBear = new Grizzly();
            ToyBear MrTeddy     = new TeddyBear();
            ToyBear ANewBear    = new BearAdapter(GrizzlyBear);

            GrizzlyBear.maul();
            GrizzlyBear.hibernate();

            MrTeddy.hug();

            ANewBear.hug();//adapted Bear class

            Console.ReadKey();
        }
Ejemplo n.º 2
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        // get a reference to the child's SummonEntityOnDeath component, this the component that makes the wolf
        SummonEntityOnDeath summoner = abilityObject.GetComponent <SummonEntityOnDeath>();

        BearAdapter adapter = abilityObject.AddComponent <BearAdapter>();

        // give the wolf weak leap if necessary
        if (thornBear)
        {
            adapter.thornBear = true;

            // Add ability
            if (thornCooldown > 0)
            {
                adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.thornTotemAttack), 1f, 1f / thornCooldown, 2f, 7f, 8f, 11f, false));
            }
            else
            {
                adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.thornTotemAttack), 0, 0, 0, 7f, 8f, 11f, false));
            }
            adapter.ThornAttackChanceToShredArmour   = ThornAttackChanceToShredArmour;
            adapter.ThornAttackChanceForDoubleDamage = ThornAttackChanceForDoubleDamage;
            adapter.thornAttackEnemiesToPierce       = thornAttackEnemiesToPierce;
        }

        if (usesSwipe)
        {
            // Add ability
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.swipe), 1, 0.2f * (1 + increasedSwipeCooldownRecovery), 0, 1f, 1.3f, 4f, false));
            adapter.swipes = usesSwipe;
        }

        if (Retaliates)
        {
            adapter.retaliates = true;
            adapter.retaliators.Add(new EntityAdapter.Retaliator(AbilityIDList.getAbility(AbilityID.thornBurst), Mathf.RoundToInt(75f * (1f - percentReducedRetaliationThreshold)), Mathf.RoundToInt(75f * (1f - percentReducedRetaliationThreshold) * 0.75f)));
            adapter.thornBurstAddedSpeed  = thornBurstAddedSpeed;
            adapter.thornBurstBleedChance = thornBurstBleedChance;
        }

        adapter.thornPoisonChance     = thornPoisonChance;
        adapter.clawTotemOnKillChance = clawTotemOnKillChance;

        return(abilityObject);
    }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Bear    grizzly     = new Grizzly();
            ToyBear teddy       = new TeddyBear();
            ToyBear adapterBear = new BearAdapter(new Grizzly());

            Console.WriteLine("Grizzly functions:");
            grizzly.Maul();
            grizzly.Hibernate();
            Console.WriteLine();

            Console.WriteLine("TeddyBear functions:");
            teddy.Hug();
            Console.WriteLine();

            Console.WriteLine("BearAdapter ToyBear functions:");
            adapterBear.Hug();

            Console.ReadLine();
        }