Beispiel #1
0
 public Hero(HeroColor heroColor, IKnife knife)
 {
     this.PositionX    = HeroStartingXPosition;
     this.PositionY    = HeroStartingYPosition;
     this.Name         = HeroName;
     this.Hp           = HP;
     this.Level        = LEVEL;
     this.Exp          = EXP;
     this.WeaponSecond = knife;
     this.heroColor    = heroColor;
 }
Beispiel #2
0
 public FakeAbstractHero(HeroColor heroColor, IKnife knife)
     : base(heroColor, knife)
 {
 }
Beispiel #3
0
		public override void changeFightColor(int fighterIndex, HeroColor color, SingleActionRecord actionRecord)
		{
			// do nothing here
		}
    // This update is called at the FPS which can be fluctuating
    // and should be called for any regular actions not based on
    // physics (i.e. everything not related to RigidBody)
    private void Update()
    {
        // If the player presses M, the map will be activated if not on screen
        // or desactivated if already on screen
        if (Input.GetKeyDown(KeyCode.M))
        {
            m_map.SetActive(!m_map.activeSelf);
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }

        // If a dialog is on screen, the player should not be updated
        // If the map is displayed, the player should not be updated
        if (m_dialogDisplayer.IsOnScreen() || m_map.activeSelf)
        {
            return;
        }
        ChangeSpriteToMatchDirection();

        // If the player presses SPACE, then two solution
        // - If there is a dialog ready to be displayed (i.e. the player is closed to a NPC)
        //   then a dialog is set to the dialogManager
        // - If not, then the player will shoot a fireball
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (m_closestNPCDialog != null)
            {
                m_dialogDisplayer.SetDialog(m_closestNPCDialog.GetDialog());
            }

            /*
             * else
             * {
             * ShootFireball();
             * }
             */
        }
        if (Input.GetKeyDown(KeyCode.Z))
        {
            ShootFireball('z');
        }
        if (Input.GetKeyDown(KeyCode.Q))
        {
            ShootFireball('q');
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
            ShootFireball('s');
        }
        if (Input.GetKeyDown(KeyCode.D))
        {
            ShootFireball('d');
        }
        if ((Input.GetKeyDown(KeyCode.Alpha1)) && (h_color == HeroColor.RED))
        {
            h_color = HeroColor.NONE;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            h_color = HeroColor.RED;
        }
        if ((Input.GetKeyDown(KeyCode.Alpha2)) && (h_color == HeroColor.GREEN))
        {
            h_color = HeroColor.NONE;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            h_color = HeroColor.GREEN;
        }
        if ((Input.GetKeyDown(KeyCode.Alpha3)) && (h_color == HeroColor.BLUE))
        {
            h_color = HeroColor.NONE;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            h_color = HeroColor.BLUE;
        }
    }
Beispiel #5
0
		public override void changeFightColor(int fighterIndex, HeroColor color, SingleActionRecord actionRecord)
		{
			HeroPoint _point = this.indexedHeroPoint[fighterIndex];
			if (!_point.InBattle)
			{
				// TODO: BattleLogger.logError
			}
			_point.updateColor(color);
			actionRecord.addProp(BattleRecordConstants.BATTLE_HERO_PROP_COLOR_CHANGE, _point.Color.Index);
		}
Beispiel #6
0
		public virtual HeroPoint createHeroPoint(BattleFighter battleFighter, HeroColor color)
		{
			HeroPoint _newPoint = new HeroPoint(battleFighter, color);
			indexedHeroPoint[battleFighter.Index] = _newPoint;
			return _newPoint;
		}
Beispiel #7
0
		public virtual void changeColor(HeroColor color, SingleActionRecord singleRecord)
		{
			getOwnerTeam().changeFightColor(index, color, singleRecord);
		}