⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sitting.py

📁 在客户端和服务器架构中
💻 PY
字号:
"""
sitting.py
"""

import shared
import shared.characterstatedata as _characterstatedata
import shared.fighting as _fighting
import shared.casting as _casting
import shared.stopped as _stopped
import shared.idle as _idle


shared.RegisterState(__name__)

def GetStateId():  
  return _characterstatedata.SITTING

def GetStateTypeId():
  return _characterstatedata.POSTURE

def OnEnterState(actor):
  # stop any movement and actions
  actor.TransitionTo(_stopped)
  actor.TransitionTo(_idle)
  
  # cannot move while sitting
  actor.BlockMovement()
  # cannot fight or cast either
  actor.BlockState(_fighting)
  actor.BlockState(_casting)

def OnExitState(actor):
  # restore movement on exit from sitting
  actor.UnblockMovement()
  # restore fighting and casting
  actor.UnblockState(_fighting)
  actor.UnblockState(_casting)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -