Exemplo n.º 1
0
        public override void OnHitMonster(Monster monster)
        {
            InteractionType interactionType = InteractionType.Sword;
            if (Player.CurrentState == Player.SwingBigSwordState)
                interactionType = InteractionType.BiggoronSword;
            else if (Player.CurrentState == Player.SpinSwordState)
                interactionType = InteractionType.SwordSpin;

            // Trigger the monster's sword reaction.
            monster.TriggerInteraction(interactionType, unit, new WeaponInteractionEventArgs() {
                Weapon = itemSword
            });

            // Stab if holding sword.
            if (Player.CurrentState == Player.HoldSwordState)
                Player.HoldSwordState.Stab(false);
            else if (Player.CurrentState == Player.SwingSwordState)
                Player.SwingSwordState.AllowSwordHold = false;
        }
Exemplo n.º 2
0
 // Instantly kill the monster.
 public static void SoftKill(Monster monster, Entity sender, EventArgs args)
 {
     monster.SoftKill();
 }
Exemplo n.º 3
0
        public void TriggerMonsterReaction(Monster monster)
        {
            // Destroy the seed and create the effect.
            Entity effect = DestroyWithEffect();

            // Trigger the immediate seed effect actions.
            if (type == SeedType.Scent)
                monster.TriggerInteraction(InteractionType.ScentSeed, effect);
            else if (type == SeedType.Pegasus)
                monster.TriggerInteraction(InteractionType.PegasusSeed, effect);
            else if (type == SeedType.Mystery)
                monster.TriggerInteraction(InteractionType.MysterySeed, effect);
        }
Exemplo n.º 4
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.RodFire, this);
 }
 public override void OnCollideMonster(Monster monster)
 {
     if (!isReturning && !isHooked && !isLifting)
         monster.TriggerInteraction(InteractionType.SwitchHook, this);
 }
Exemplo n.º 6
0
 public static void Kill(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is Unit)
         (sender as Unit).Kill();
     else
         sender.Destroy();
 }
Exemplo n.º 7
0
 //-----------------------------------------------------------------------------
 // Basic Sender Reactions
 //-----------------------------------------------------------------------------
 public static void Destroy(Monster monster, Entity sender, EventArgs args)
 {
     sender.Destroy();
 }
Exemplo n.º 8
0
 public static void Bump(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is Unit)
         (sender as Unit).Bump(monster.Center);
 }
Exemplo n.º 9
0
 // Burn the monster for 1 damage.
 public static void Burn(Monster monster, Entity sender, EventArgs args)
 {
     monster.Burn(1);
     if (sender is Fire)
         sender.Destroy();
 }
Exemplo n.º 10
0
 // Bump the monster.
 public static void Bump(Monster monster, Entity sender, EventArgs args)
 {
     AudioSystem.PlaySound(GameData.SOUND_BOMB_BOUNCE);
     monster.Bump(sender.Center);
 }
Exemplo n.º 11
0
 public void Trigger(Monster monster, Entity sender, EventArgs args)
 {
     if (handler != null)
         handler.Invoke(monster, sender, args);
 }
Exemplo n.º 12
0
 public virtual void OnHitMonster(Monster monster)
 {
 }
Exemplo n.º 13
0
 public override void OnHitMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.Shield, unit, new WeaponInteractionEventArgs() {
         Weapon = itemShield
     });
 }
Exemplo n.º 14
0
 // Stun the monster.
 public static void Stun(Monster monster, Entity sender, EventArgs args)
 {
     monster.Stun();
 }
Exemplo n.º 15
0
            // Stun the monster.
            public static void ClingEffect(Monster monster, Entity sender, EventArgs args)
            {
                Effect effect = new EffectCling();

                Vector2F effectPos = (monster.Center + sender.Center) * 0.5f;
                if (args is InteractionArgs)
                    effectPos = (args as InteractionArgs).ContactPoint;

                monster.RoomControl.SpawnEntity(effect, effectPos);
                AudioSystem.PlaySound(GameData.SOUND_EFFECT_CLING);
            }
Exemplo n.º 16
0
 // Switch places with the monster (Only for switch-hook interactions).
 public static void SwitchHook(Monster monster, Entity sender, EventArgs args)
 {
     SwitchHookProjectile hook = sender as SwitchHookProjectile;
     hook.SwitchWithEntity(monster);
     monster.BeginState(new MonsterBusyState(20));
 }
Exemplo n.º 17
0
 // Damage the monster for 4 damage.
 public static void Damage4(Monster monster, Entity sender, EventArgs args)
 {
     monster.Hurt(4, sender.Center);
 }
Exemplo n.º 18
0
 public static void Damage(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is Unit)
         (sender as Unit).Hurt(1, monster.Center);
 }
Exemplo n.º 19
0
 // Send the monster in a gale.
 public static void Gale(Monster monster, Entity sender, EventArgs args)
 {
     monster.EnterGale((EffectGale) sender);
 }
Exemplo n.º 20
0
 public static void Intercept(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is IInterceptable)
         (sender as IInterceptable).Intercept();
 }
Exemplo n.º 21
0
            // Trigger a random seed effect.
            public static void MysterySeed(Monster monster, Entity sender, EventArgs args)
            {
                // Random: burn, stun, damage, gale
                int rand = GRandom.NextInt(4);
                SeedEntity seed = (SeedEntity) sender;

                if (rand == 0)
                    seed.SeedType = SeedType.Ember;
                else if (rand == 1)
                    seed.SeedType = SeedType.Scent;
                else if (rand == 2)
                    seed.SeedType = SeedType.Pegasus;
                else
                    seed.SeedType = SeedType.Gale;

                monster.TriggerInteraction(Monster.GetSeedInteractionType(seed.SeedType), sender, args);
            }
Exemplo n.º 22
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.OnSeedHit(this);
 }
Exemplo n.º 23
0
            // Bump the monster and sender.
            public static void Parry(Monster monster, Entity sender, EventArgs args)
            {
                monster.Bump(sender.Center);
                Unit unitSender = sender as Unit;

                if (unitSender != null && !unitSender.IsBeingKnockedBack) {
                    unitSender.Bump(monster.Center);
                    AudioSystem.PlaySound(GameData.SOUND_EFFECT_CLING);
                }
            }
Exemplo n.º 24
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.Boomerang, this);
 }
Exemplo n.º 25
0
            // Bump the monster and sender.
            public static void ParryWithClingEffect(Monster monster, Entity sender, EventArgs args)
            {
                monster.Bump(sender.Center);
                Unit unitSender = sender as Unit;

                if (unitSender != null && !unitSender.IsBeingKnockedBack && !monster.IsBeingKnockedBack) {
                    unitSender.Bump(monster.Center);
                    AudioSystem.PlaySound(GameData.SOUND_EFFECT_CLING);

                    Effect effect = new EffectCling();
                    Vector2F effectPos = (monster.Center + sender.Center) * 0.5f;
                    if (args is InteractionArgs)
                        effectPos = (args as InteractionArgs).ContactPoint;
                    monster.RoomControl.SpawnEntity(effect, effectPos);
                }
            }
Exemplo n.º 26
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.SwordBeam, this);
 }
Exemplo n.º 27
0
 public virtual void OnCollideMonster(Monster monster)
 {
 }