重构玩家交互事件系统,尝试支持可通过网络传递的自定义事件
This commit is contained in:
@@ -570,6 +570,16 @@ function applyCustomGame()-- Apply CUSTOMENV, BAG, MISSION
|
||||
GAME.modeEnv.mission=nil
|
||||
end
|
||||
end
|
||||
local defaultAttackRule={
|
||||
extraEvent={
|
||||
{'attack',4},
|
||||
},
|
||||
extraEventHandler={
|
||||
attack=function(P,P2,...)
|
||||
P:beAttacked(P2,...)
|
||||
end,
|
||||
},
|
||||
}
|
||||
function loadGame(mode,ifQuickPlay,ifNet)-- Load a mode and go to game scene
|
||||
freshDate()
|
||||
if legalGameTime() then
|
||||
@@ -577,6 +587,7 @@ function loadGame(mode,ifQuickPlay,ifNet)-- Load a mode and go to game scene
|
||||
MODES[mode]=require('parts.modes.'..mode)
|
||||
MODES[mode].name=mode
|
||||
end
|
||||
TABLE.complete(defaultAttackRule,MODES[mode])
|
||||
if MODES[mode].score then
|
||||
STAT.lastPlay=mode
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user