コード例 #1
0
ファイル: EnemyBehavior.cs プロジェクト: maestun/wonderboy
 public EnemyBehavior(GameObject p_object, int p_hitPoints, int delay, ActivationTypes p_activationType, FacePlayerBehavior p_fpBehavior)
 {
     this.hitPoints = 5;
     this.awakenDistance = 300;
     this.attackDistance = 60;
     this.ignoreHitFloor = true;
     this.Init(p_object, p_hitPoints, delay, p_activationType, p_fpBehavior);
 }
コード例 #2
0
ファイル: EnemyBehavior.cs プロジェクト: maestun/wonderboy
 private void Init(GameObject p_object, int p_hitPoints, int delay, ActivationTypes p_activationType, FacePlayerBehavior p_fpBehavior)
 {
     this.actType = p_activationType;
     this.fpBehavior = p_fpBehavior;
     this.hitPoints = p_hitPoints;
     this.maxHitpoints = p_hitPoints;
     this.actionQueue = new Queue<GameAction>();
     this.thisObject = p_object;
     this.nearEventResponse = new EventResponse();
     this.farEventResponse = new EventResponse();
     this.hitEventResponse = new EventResponse();
     this.hitWallEventResponse = new EventResponse();
     this.playerAttackEventResponse = new EventResponse();
     this.itemDrops = new List<ItemDropProfile>();
     this.TimerOffset = delay;
     if ((this.fpBehavior == FacePlayerBehavior.FaceWhenCreated) && (this.timerOffset <= 0))
     {
         this.timerOffset = 1;
     }
     this.currentState = BehaviorStates.Start;
     if (this.thisObject.ObjClass == ObjectClass.Boss)
     {
         this.hitSound = SoundEffects.BossHit;
         this.dieSound = SoundEffects.BossDie;
     }
     else
     {
         this.hitSound = SoundEffects.HitEnemy;
         this.dieSound = SoundEffects.EnemyDie;
     }
 }