//------------------------------------------------------------------------------------------------------------------ public void UseShoutSkill(Combat.IMediator mediator) { m_skill_6.UseSkill(true); UNIT_ISoldier soldier = this; soldier.DoShoutSkillBehaviour(mediator); }
//------------------------------------------------------------------------------------------------------------------ public void UseHeavenSpinSKill(Combat.IMediator mediator) { m_skill_7.UseSkill(true); UNIT_ISoldier soldier = this; soldier.DoHeavenSpinSkillBehaviour(mediator); }
//------------------------------------------------------------------------------------------------------------------ public void UseLeapOfFaithSkill(Combat.IMediator mediator) { m_skill_5.UseSkill(true); UNIT_ISoldier soldier = this; soldier.DoLeapOfFaithSkillBehaviour(mediator); }
//------------------------------------------------------------------------------------------------------------------ public void UseInvencibleShieldSkill(Combat.IMediator mediator) { m_skill_4.UseSkill(true); UNIT_ISoldier soldier = this; soldier.DoInvencibleShieldSkillBehaviour(mediator); }
//------------------------------------------------------------------------------------------------------------------ public void UseBlindTortureSkill(Combat.IMediator mediator) { m_skill_3.UseSkill(true); UNIT_ISoldier soldier = this; soldier.DoBlindTortureSkillBehaviour(mediator); }
//------------------------------------------------------------------------------------------------------------------ public void UseImpactSliceSkill(Combat.IMediator mediator) { m_skill_2.UseSkill(true); //m_skill_2 UNIT_ISoldier soldier = this; soldier.DoImpactSliceSkillBehaviour(mediator); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.Update(Combat.IMediator mediator) { UNIT_ISoldier hero = this; //lock camera on player movement GameObject.Find("GAMEOBJ_Dummy").transform.position = this.m_heroGameObject.transform.position; //activate Runner skill if (GameSystem.HeroControl.RightMouseClickDown()) { this.UseRunnerSkill(); } m_skill_1.UpdateSkill(); m_skill_2.UpdateSkill(); m_skill_3.UpdateSkill(); m_skill_4.UpdateSkill(); m_skill_5.UpdateSkill(); m_skill_6.UpdateSkill(); m_skill_7.UpdateSkill(); //keep player at NavigationMesh if (GameSystem.HeroControl.LeftMouseClick()) { if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out m_hitPosition, 100)) { //if (hitPosition.collider.gameObject.tag == "NavigationMesh") { hero.MoveTo(m_hitPosition.point); } } } //keep walking until character reach hitPosition Vector3 position = hero.GetPosition(); if (Vector3.Distance(position, m_hitPosition.point) <= 0.2f) { hero.SetState((int)Combat.HeroStates.HERO_IDLE); } else { hero.SetState((int)Combat.HeroStates.HERO_RUN); } //messages to mediator mediator.DistributeMessageHeroPosition(this); }
//------------------------------------------------------------------------------------------------------------------ protected SYS_GameManager() { #if (PLAYER) //create hero m_hero = new Combat.UNIT_Hero(100, 10, new Vector3(0, 0, 0)); #endif #if (MONSTERS) //create enemy army m_enemyArmy = new List <Combat.UNIT_ISoldier>(); for (int i = 0; i < 1; i++) { Vector3 position = new Vector3(Random.Range(-30.0f, 30.0f), 0, Random.Range(-30.0f, 30.0f)); float visionRadius = 20.0f; // Random.Range(5.0f, 15.0f); float movementSpeed = 20.0f; // Random.Range(5.0f, 20.0f); m_enemyArmy.Add(new Combat.UNIT_Enemy(100, 10, visionRadius, movementSpeed, position)); } #endif #if (COMBAT) //create Combat mediator m_combatMediator = new Combat.SYS_CombatMediator(); //register soldiers for combat mediator m_combatMediator.RegisterSoldier(m_hero); foreach (Combat.UNIT_ISoldier enemy in m_enemyArmy) { m_combatMediator.RegisterSoldier(enemy); } #endif #if HUD //create HUD this.m_playerHUD = new HUD.SYS_PlayerHUD(); #endif }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoHeavenSpinSkillBehaviour(Combat.IMediator mediator) { //mediator.DistributeMessageHeroHeavenSpinSkill(this); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoInvencibleShieldSkillBehaviour(Combat.IMediator mediator) { //mediator.DistributeMessageHeroInvencibleShieldSkill(this); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.Update(Combat.IMediator mediator) { //this.Chase(mediator); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoLeapOfFaithSkillBehaviour(Combat.IMediator mediator) { //do nothing }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoHeavenSpinSkillBehaviour(Combat.IMediator mediator) { //do nothing }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoBlindTortureSkillBehaviour(Combat.IMediator mediator) { //do nothing }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoShoutSkillBehaviour(Combat.IMediator mediator) { //do nothing }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.Attack(Combat.IMediator mediator, int damage) { //mediator.AdviceAForAttack(this, damage); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoImpactSliceSkillBehaviour(Combat.IMediator mediator) { //do nothing }
//------------------------------------------------------------------------------------------------------------------ private void Chase(Combat.IMediator mediator) { //mediator.DistributeMessageHeroPosition(this); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoRunnerSkillBehaviour(Combat.IMediator mediator) { }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoLeapOfFaithSkillBehaviour(Combat.IMediator mediator) { //mediator.DistributeMessageHeroLeapOfFaithSkill(this); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoBlindTortureSkillBehaviour(Combat.IMediator mediator) { //mediator.DistributeMessageHeroBlindTortureSkill(this); }
//------------------------------------------------------------------------------------------------------------------ void UNIT_ISoldier.DoImpactSliceSkillBehaviour(Combat.IMediator mediator) { //mediator.DistributeMessageHeroImpactSliceSkill(this); }