//----------------------------------------------------------------------------- // Overridden Methods //----------------------------------------------------------------------------- public override void OnBegin(MonsterState previousState) { timer = 0; monster.Physics.Velocity = Vector2F.Zero; monster.Graphics.PauseAnimation(); }
//----------------------------------------------------------------------------- // Overridden Methods //----------------------------------------------------------------------------- public override void OnBegin(MonsterState previousState) { monster.Graphics.AnimationPlayer.Speed = 2.0f; monster.Graphics.AnimationPlayer.Play(); monster.Physics.Velocity = Vector2F.Zero; monster.IsPassable = true; }
//----------------------------------------------------------------------------- // Overridden Methods //----------------------------------------------------------------------------- public override void OnBegin(MonsterState previousState) { timer = 0; flameAnimationPlayer.Play(GameData.ANIM_EFFECT_BURN); monster.Physics.Velocity = Vector2F.Zero; monster.Graphics.PauseAnimation(); monster.IsPassable = true; // Apply damage (make monster invincible for burn duration). DamageInfo damageInfo = new DamageInfo(burnDamage); damageInfo.ApplyKnockBack = false; damageInfo.Flicker = false; damageInfo.InvincibleDuration = burnDuration; monster.Hurt(damageInfo); }
//----------------------------------------------------------------------------- // Overridden Methods //----------------------------------------------------------------------------- public override void OnBegin(MonsterState previousState) { monster.IsPassable = true; if (galeEffect != null) { monster.SetPositionByCenter(galeEffect.Position); galeEffect.DestroyAndTransform(monster); galeEffect = null; } timer = 0; isRising = false; galeZPosition = monster.ZPosition; monsterPosition = monster.Position; monster.Physics.Velocity = Vector2F.Zero; monster.Graphics.PauseAnimation(); monster.DisablePhysics(); galeAnimationPlayer.Play(GameData.ANIM_EFFECT_SEED_GALE); }
public virtual void OnEnd(MonsterState newState) { }
//----------------------------------------------------------------------------- // Overridden Methods //----------------------------------------------------------------------------- public override void OnBegin(MonsterState previousState) { }
//----------------------------------------------------------------------------- // Begin/end //----------------------------------------------------------------------------- public void Begin(Monster monster, MonsterState previousState) { this.monster = monster; this.isActive = true; OnBegin(previousState); }
public override void OnEnd(MonsterState newState) { }
public override void OnEnd(MonsterState newState) { monster.Graphics.ResumeAnimation(); monster.IsPassable = false; }
public void End(MonsterState newState) { this.isActive = false; OnEnd(newState); }
public override void OnEnd(MonsterState newState) { // Monster should be destroyed, no need to change back to normal...? }
public override void OnEnd(MonsterState newState) { monster.Graphics.ResumeAnimation(); }
//----------------------------------------------------------------------------- // Virtual methods //----------------------------------------------------------------------------- public virtual void OnBegin(MonsterState previousState) { }
public override void OnEnd(MonsterState newState) { monster.Graphics.AnimationPlayer.Speed = 1.0f; monster.IsPassable = false; }
//----------------------------------------------------------------------------- // Monster States //----------------------------------------------------------------------------- // Begin the given monster state. public void BeginState(MonsterState newState) { if (state != newState) { if (state != null) { state.End(newState); } previousState = state; state = newState; newState.Begin(this, previousState); } }
//----------------------------------------------------------------------------- // Overridden Methods //----------------------------------------------------------------------------- public override void Initialize() { base.Initialize(); color = (MonsterColor) Properties.GetInteger("color", (int) color); health = healthMax; Graphics.PlayAnimation(GameData.ANIM_MONSTER_OCTOROK); ChooseImageVariant(); // Begin the default monster state. BeginNormalState(); previousState = state; }