Exemplo n.º 1
0
 public MonsterB()
 {
     _Settings = new MonsterSettings {
         Name                 = "MonsterB",
         EXP                  = 5,
         MaxHP                = 400,
         MaxMP                = 50,
         BodyRange            = 5,
         MoveSpeed            = 10,
         AlertRange           = 50,
         AttackRange          = 15,
         AttackInterval       = 1,
         ThreatChangeSpeed    = 1,
         EscapingStartHPLimit = 100,
         EscapingEndHPLimit   = 300,
         AngryThreatLimit     = 200,
         MoveThreatLimit      = 50,
     };
     Entity = GameObject.Instantiate <GameObject>(Game.MonsterPrefab);
     Entity.transform.localScale = new Vector3(_Settings.BodyRange, _Settings.BodyRange, 1);
     Entity.GetComponent <MeshRenderer>().material.color = new Color(255, 0, 0);
     HealthBoard = GameObject.Instantiate <GameObject>(Game.HealthBoardPrefab);
     HBText      = HealthBoard.GetComponent <TextMesh>();
     Controller  = new MonsterStateController(this);
     SetID(Game.GetMonsterID());
     SetThreat(0);
     SetHP(_Settings.MaxHP);
     SetMP(_Settings.MaxMP);
 }
Exemplo n.º 2
0
 public override void UpdateHB()
 {
     HealthBoard.GetComponent <TextMesh>().text =
         _Settings.Name + Environment.NewLine
         + Mathf.FloorToInt(HP) + "/" + Mathf.FloorToInt(_Settings.MaxHP) + Environment.NewLine
         + Mathf.FloorToInt(MP) + "/" + Mathf.FloorToInt(_Settings.MaxMP);
 }
Exemplo n.º 3
0
 public void Update()
 {
     if (EXP != 0)
     {
         RefreshLevel();
     }
     if (BulletAmount == 0 && Time.time - ReloadStartTime > GunReloadInterval)
     {
         Reload();
     }
     if (Time.time > PeaceStartTime + WaitNoHealingTime)
     {
         HPChange(Time.deltaTime * WaitHPHealingSpeed);
         MPChange(Time.deltaTime * WaitMPHealingSpeed);
     }
     Controller.Update();
     HealthBoard.GetComponent <TextMesh>().text =
         "Player Lv." + Level + Environment.NewLine
         + Mathf.FloorToInt(HP) + "/" + Mathf.FloorToInt(MaxHP) + Environment.NewLine
         + Mathf.FloorToInt(MP) + "/" + Mathf.FloorToInt(MaxMP) + Environment.NewLine
         + BulletAmount + "/" + GunBulletAmount;
 }