Esempio n. 1
0
def idleTargetState(self):
	# Process hit detect from target mode
	if (hitFromTarget(self)):
		return

	self.targetManager.activeHeadTrack()
	# If respect ground rule
	if ( self.respectGroundRule(endTargetState) ):
		# if always found enemy and z key is holded
		if (self.targetManager.canFindObject() and self.gamepad.isZPressed() ):
			# * Jump attack
			if (self.gamepad.isActionPressed() and self.armed):
				start_jumpAttack(self)
				return

			# Basic combo attack
			if (self.gamepad.isAttackPressed()):
				if (self.armed == False):
					self.activeArmedMode()
				else:
					start_basicSwordAttack1State(self)

			elif ( self.targetManager.targetMovement(self) ):
				self.switchState(PlayerState.STRAFE_STATE)
			else:
				self.rig.playTargetIdle()
		else:
			self.targetManager.deactivateTargetMode()
			self.switchState(PlayerState.IDLE_STATE)
def idleTargetState(self):
    # Process hit detect from target mode
    if (hitFromTarget(self)):
        return

    if (self.targetManager.active):
        if (self.targetManager.isHaveTargetObject()):
            self.targetManager.activeHeadTrack()
    else:
        endTargetState(self)
        self.switchState(PlayerState.IDLE_STATE)
        return
    # If respect ground rule
    if (self.respectGroundRule(endTargetState)):
        # if always found enemy and z key is holded
        if (self.targetManager.active and self.gamepad.isZPressed()):
            # * Jump attack
            if (self.gamepad.isActionPressed()
                    and self.fightManager.isUnsheated()):
                if (self.targetManager.parry):
                    start_specialRollState(self)
                else:
                    start_jumpAttack(self)
                return

            # Basic combo attack
            if (self.gamepad.isAttackPressed()
                    and self.fightManager.canUseSword()):
                if (not self.fightManager.isUnsheated()):
                    self.unsheat()
                else:
                    start_basicSwordAttack1State(self)

            elif (self.targetManager.targetMovement(self)):
                self.switchState(PlayerState.STRAFE_STATE)
            else:
                self.rig.playTargetIdle()
        else:
            self.switchState(PlayerState.IDLE_STATE)
def idleTargetState(self):
    # Process hit detect from target mode
    if hitFromTarget(self):
        return

    if self.targetManager.active:
        if self.targetManager.isHaveTargetObject():
            self.targetManager.activeHeadTrack()
    else:
        endTargetState(self)
        self.switchState(PlayerState.IDLE_STATE)
        return
        # If respect ground rule
    if self.respectGroundRule(endTargetState):
        # if always found enemy and z key is holded
        if self.targetManager.active and self.gamepad.isZPressed():
            # * Jump attack
            if self.gamepad.isActionPressed() and self.fightManager.isUnsheated():
                if self.targetManager.parry:
                    start_specialRollState(self)
                else:
                    start_jumpAttack(self)
                return

                # Basic combo attack
            if self.gamepad.isAttackPressed() and self.fightManager.canUseSword():
                if not self.fightManager.isUnsheated():
                    self.unsheat()
                else:
                    start_basicSwordAttack1State(self)

            elif self.targetManager.targetMovement(self):
                self.switchState(PlayerState.STRAFE_STATE)
            else:
                self.rig.playTargetIdle()
        else:
            self.switchState(PlayerState.IDLE_STATE)