Пример #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;
        }
Пример #2
0
 // Instantly kill the monster.
 public static void SoftKill(Monster monster, Entity sender, EventArgs args)
 {
     monster.SoftKill();
 }
Пример #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);
        }
Пример #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);
 }
Пример #6
0
 public static void Kill(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is Unit)
         (sender as Unit).Kill();
     else
         sender.Destroy();
 }
Пример #7
0
 //-----------------------------------------------------------------------------
 // Basic Sender Reactions
 //-----------------------------------------------------------------------------
 public static void Destroy(Monster monster, Entity sender, EventArgs args)
 {
     sender.Destroy();
 }
Пример #8
0
 public static void Bump(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is Unit)
         (sender as Unit).Bump(monster.Center);
 }
Пример #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();
 }
Пример #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);
 }
Пример #11
0
 public void Trigger(Monster monster, Entity sender, EventArgs args)
 {
     if (handler != null)
         handler.Invoke(monster, sender, args);
 }
Пример #12
0
 public virtual void OnHitMonster(Monster monster)
 {
 }
Пример #13
0
 public override void OnHitMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.Shield, unit, new WeaponInteractionEventArgs() {
         Weapon = itemShield
     });
 }
Пример #14
0
 // Stun the monster.
 public static void Stun(Monster monster, Entity sender, EventArgs args)
 {
     monster.Stun();
 }
Пример #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);
            }
Пример #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));
 }
Пример #17
0
 // Damage the monster for 4 damage.
 public static void Damage4(Monster monster, Entity sender, EventArgs args)
 {
     monster.Hurt(4, sender.Center);
 }
Пример #18
0
 public static void Damage(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is Unit)
         (sender as Unit).Hurt(1, monster.Center);
 }
Пример #19
0
 // Send the monster in a gale.
 public static void Gale(Monster monster, Entity sender, EventArgs args)
 {
     monster.EnterGale((EffectGale) sender);
 }
Пример #20
0
 public static void Intercept(Monster monster, Entity sender, EventArgs args)
 {
     if (sender is IInterceptable)
         (sender as IInterceptable).Intercept();
 }
Пример #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);
            }
Пример #22
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.OnSeedHit(this);
 }
Пример #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);
                }
            }
Пример #24
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.Boomerang, this);
 }
Пример #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);
                }
            }
Пример #26
0
 public override void OnCollideMonster(Monster monster)
 {
     monster.TriggerInteraction(InteractionType.SwordBeam, this);
 }
Пример #27
0
 public virtual void OnCollideMonster(Monster monster)
 {
 }