
# 导入所需的库和模块
from sgsim import sgs
# 创建一个新的技能类
class ExampleSkill(sgs.Skill):
# 定义技能的名称、描述和类型
name = "example_skill"
description = "这是一个示例技能"
type = sgs.Skill.Type.ACTIVE
def __init__(self, player):
super().__init__(player)
self.add_command("example_command") # 添加技能的命令
def on_enable(self, room, player):
super().on_enable(room, player)
room.notify_skill_invoked(player, self) # 通知技能被发动
def on_command(self, player, command):
super().on_command(player, command)
if command == "example_command":
# 在这里编写技能的具体逻辑
pass
# 注册技能到游戏中
sgs.Skill.register(ExampleSkill)
