|
|
楼主 |
发表于 2015-4-11 16:38:40
|
显示全部楼层
一整个余波开始的JASS:
作者到底哪些部分是用JASS写的哪些是用触发的?
function OperationSilentHill takes nothing returns nothing
local trigger t = CreateTrigger()
local trigger t2 = CreateTrigger() //-prime
local integer i = 1
local integer allowboot = 1
local real x
local real y
local player p
local location l = Location(11735.0,15716.0)
local group g = AMGetUnitsInRange(600,l,null)//一大坨局部变量声明
set udg_EchoCompany = GetPlayersByMapControl(MAP_CONTROL_USER)//EchoCompany似乎是一个玩家组,意思是说Ecompany=所有用户控制的玩家,也就是真人
call ForGroup(g,function RemoveUnitAll)//选取g里头的单位做动作,清空单位组,意义不明
call DestroyGroup(g)//删除单位组
call RemoveLocation(l)//清除点l
set g=null
set l=null
call ForceAddPlayer(udg_FireTeamA,Player(0))
call ForceAddPlayer(udg_FireTeamA,Player(1))
call ForceAddPlayer(udg_FireTeamA,Player(2))
call ForceAddPlayer(udg_FireTeamA,Player(3))
call ForceAddPlayer(udg_FireTeamA,Player(4))
call SetPlayerColor(Player(0),PLAYER_COLOR_RED)
call SetPlayerColor(Player(1),PLAYER_COLOR_RED)
call SetPlayerColor(Player(2),PLAYER_COLOR_RED)
call SetPlayerColor(Player(3),PLAYER_COLOR_RED)
call SetPlayerColor(Player(4),PLAYER_COLOR_RED)
call ForceAddPlayer(udg_FireTeamB,Player(5))
call ForceAddPlayer(udg_FireTeamB,Player(6))
call ForceAddPlayer(udg_FireTeamB,Player(7))
call ForceAddPlayer(udg_FireTeamB,Player(8))
call ForceAddPlayer(udg_FireTeamB,Player(10))
call SetPlayerColor(Player(5),PLAYER_COLOR_BLUE)
call SetPlayerColor(Player(6),PLAYER_COLOR_BLUE)
call SetPlayerColor(Player(7),PLAYER_COLOR_BLUE)
call SetPlayerColor(Player(8),PLAYER_COLOR_BLUE)
call SetPlayerColor(Player(10),PLAYER_COLOR_BLUE)//设置两队玩家,疑似是死亡竞赛用的
call SetPlayerColor(Player(13),ConvertPlayerColor(12))
call SetPlayerOnScoreScreen(Player(13),false)
call SetPlayerOnScoreScreen(Player(14),false)
call SetPlayerOnScoreScreen(Player(9),false)//玩家9,13,14不会显示在计分屏上
call ForForce(udg_EchoCompany,function TriggerEventInitialize)//注册玩家单位事件
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[9], udg_EchoCompany, bj_ALLIANCE_ALLIED )//设置玩家联盟状态
call SetForceAllianceStateBJ(udg_EchoCompany, bj_FORCE_PLAYER[9], bj_ALLIANCE_ALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[11], udg_EchoCompany, bj_ALLIANCE_ALLIED )
call SetForceAllianceStateBJ(udg_EchoCompany, bj_FORCE_PLAYER[11], bj_ALLIANCE_ALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[13], GetPlayersAllies(Player(0)), bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(GetPlayersAllies(Player(0)), bj_FORCE_PLAYER[13], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[13], bj_FORCE_PLAYER[9], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[9], bj_FORCE_PLAYER[13], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[13], bj_FORCE_PLAYER[11], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[11], bj_FORCE_PLAYER[13], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[14], bj_FORCE_PLAYER[9], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[9], bj_FORCE_PLAYER[14], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[14], bj_FORCE_PLAYER[11], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[11], bj_FORCE_PLAYER[14], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[13], bj_FORCE_PLAYER[14], bj_ALLIANCE_ALLIED_VISION )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[14], bj_FORCE_PLAYER[13], bj_ALLIANCE_ALLIED_VISION )
call SetPlayerState(Player(13),PLAYER_STATE_GIVES_BOUNTY,0)
call SetPlayerState(Player(14),PLAYER_STATE_GIVES_BOUNTY,0)
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[14], udg_FireTeamA, bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(udg_FireTeamA, bj_FORCE_PLAYER[14], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[13], udg_FireTeamA, bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(udg_FireTeamA, bj_FORCE_PLAYER[13], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[14], udg_FireTeamB, bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(udg_FireTeamB, bj_FORCE_PLAYER[14], bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(bj_FORCE_PLAYER[13], udg_FireTeamB, bj_ALLIANCE_UNALLIED )
call SetForceAllianceStateBJ(udg_FireTeamB, bj_FORCE_PLAYER[13], bj_ALLIANCE_UNALLIED )
call SetPlayerName(Player(13),"未知实体")
call SetPlayerName(Player(14),"未知实体")//这一段全部都是在设置玩家的属性
call FogEnable(true)//启用战争迷雾
call FogMaskEnable(true)//启用黑色阴影
set udg_Lighting = true
call AbortCinematicFadeBJ()//不知为何有个Abort,只找到了淡入淡出滤镜
call CinematicFadeCommonBJ(0.0,0.0,0.0,0.0,"ReplaceableTextures\\CameraMasks\\Black_mask.blp", 100,0.0)//滤镜
call VolumeGroupSetVolumeBJ(SOUND_VOLUMEGROUP_MUSIC,0.0)
call VolumeGroupSetVolumeBJ(SOUND_VOLUMEGROUP_UNITSOUNDS,0.0)//设置多通道音量
call ShowInterface(false,0.0)//关闭信箱模式
call TriggerSleepAction(0.)
call ExecuteFunc("GameInitA")//看了一下这个函数貌似跟单位说的话有关,不明
if GetRandomInt(0,50)==1 then
call IntroC()
elseif GetRandomInt(0,5)==1 then
call IntroB()
else
call IntroA()
endif//运行开头的电影
call PolledWait(1.3)
call ExecuteFunc("EvilSheep")//貌似是幽灵羊
call ClearTextMessages()//清除文本
call PolledWait(0.15)
if udg_InitialPlayers==1 and RedCheatsAvailable() then//玩家是不是在进行单人游戏,看样子余波还能保存本地数据
call DisableTrigger(gg_trg_Combat)//combat关闭
set allowboot = 0
set udg_Mode=4
endif
call ResetToGameCamera(0)//重置游戏镜头
call PanCameraToTimed(GetUnitX(gg_unit_ntav_0005),GetUnitY(gg_unit_ntav_0005),0)旋转镜头
call SetForceAllianceStateBJ(udg_EchoCompany,udg_EchoCompany,bj_ALLIANCE_ALLIED)//设置玩家联盟属性
call RemoveUnit(udg_GlobalUnit[1])//删除GlobalUnit[1],不记得是什么了
call ForForce(udg_EchoCompany, function IntroEngineC)//选取玩家组运行一个大概是初始化的函数
call DialogSetMessage(udg_ModeDialog,"选择模式")
set udg_DialogButton[1] = DialogAddButton(udg_ModeDialog, "|cff778899生存模式|r", 0 )
set udg_DialogButton[2] = DialogAddButton(udg_ModeDialog, "|cff778899死亡竞赛|r", 0 )
call TriggerSleepAction(0.)
set i=0
loop
exitwhen i>udg_Players
if GetPlayerSlotState(Player(i))!=PLAYER_SLOT_STATE_LEFT then
set p = Player(i)
exitwhen 1==1
endif
set i=i+1
endloop
set i=1
loop
exitwhen i>udg_InitialPlayers
set udg_PlayerIcon[udg_Sorted] = "UI\\Widgets\\EscMenu\\Human\\blank-background.blp"
set i=i+1
endloop
if GetLocalPlayer()==p then
call ShowInterface(true,0.2)
else
call StartSound(gg_snd_ALICEBeep)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0.0,0.0,10.0,"正在初始化...")
endif
call DialogDisplay(p,udg_ModeDialog,true)
loop
exitwhen udg_DialogResponse[1]==1 or udg_myint==10 or udg_Players<2
call TriggerSleepAction(1.)
set udg_myint = udg_myint + 1
endloop
call DialogDisplay(p,udg_ModeDialog,false)
if udg_myint==10 or udg_Players<2 then
call ExecuteFunc("SurvivalInit")
endif
call ShowInterface(true,0.75)
call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 0.0, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0.0)
set udg_Lighting = false
call TriggerSleepAction(0.)
call IntermissionRestore()
call CameraSetTargetNoise(5.0,0.03)
if udg_Mode!=3 then
call DialogSetMessage(udg_DifficultyDialog,"难度选择")
set udg_DialogButton[1] = DialogAddButton( udg_DifficultyDialog, "|cff778899正常|r", 0 )
set udg_DialogButton[2] = DialogAddButton( udg_DifficultyDialog, "|cff778899噩梦|r", 0 )
if allowboot==1 then
set udg_DialogButton[3] = DialogAddButton( udg_DifficultyDialog, "|cff778899新兵营|r", 0 )
endif
call DialogDisplay(p,udg_DifficultyDialog,true)
set udg_myint=0
loop
exitwhen udg_DialogResponse[2]==1 or udg_myint==10
call TriggerSleepAction(1.)
set udg_myint = udg_myint + 1
endloop
call DialogDisplay(p,udg_DifficultyDialog,false)
if udg_Difficulty>=4.0 then
set udg_DifficultyString = " 难度 : 噩梦"
call SetPlayerHandicap(Player(13),GetPlayerHandicap(Player(13))+0.28)
call SetPlayerHandicap(Player(14),GetPlayerHandicap(Player(14))+0.28)
set udg_Pace = 0.8
set udg_XPFactor = udg_XPFactor*2
elseif udg_Difficulty>=2.0 then
set udg_DifficultyString = " 难度 : 正常"
else
set udg_DifficultyString = " 难度 : 新兵营"
set udg_XPFactor = 0.0
endif
if udg_XPFactor!=0.2 then //default normal
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 10.0, udg_DifficultyString )
endif
call QuestSetTitle( udg_QuestDifficulty, SubString(udg_DifficultyString, 13, 100) )
endif
set udg_ACA[10] = true
set udg_ACA[12] = true
call ExecuteFunc("ALICEInit")
call DialogClear(udg_DifficultyDialog)
call DialogClear(udg_ModeDialog)
call ClearSelection()
if udg_Mode!=3 then
call SelectUnit(udg_BlackHawk,true)
endif
set i=1
loop
exitwhen i>10
set x = GetRandomReal(-4000.0,10000.0)
set y = GetRandomReal(-4000.0,10000.0)
call CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'ndog',x,y,0.0)
call TriggerSleepAction(0.)
set i=i+1
endloop
set i=1
loop
exitwhen i>udg_Players
call TriggerRegisterPlayerEventLeave( t, ConvertedPlayer(udg_Sorted) )
call TriggerRegisterPlayerChatEvent( t2, ConvertedPlayer(udg_Sorted), "-prime", false )
set i=i+1
endloop
call TriggerAddAction(t,function Leaver)
call TriggerAddAction(t2,function SatchelPrimer)
call TriggerRegisterTimerEvent(gg_trg_AI_Neutral_Victim,6.1,true)
call TriggerRegisterTimerEvent(gg_trg_AI_Neutral_Extra,6.2,true)
set t = null
set t2 = null
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ghoul_Spawn, Player(14), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ghoul_Spawn, Player(13), EVENT_PLAYER_UNIT_DEATH )
call RemoveRect(gg_rct_IntroCam1)
call RemoveRect(gg_rct_IntroCam2)
call RemoveRect(gg_rct_IntroCam3)
call RemoveRect(gg_rct_IntroCam4)
call RemoveRect(gg_rct_IntroCam5)
call RemoveRect(gg_rct_IntroCam6)
call RemoveRect(gg_rct_IntroCam7)
call DestroyTrigger(gg_trg_Operation_Silent_Hill)
set i=1
if GetRandomInt(0,25)==1 then
loop
exitwhen i>10
set x = GetRandomReal(-2000.0,500.0)
set y = GetRandomReal(-800.0,1200.0)
call CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'n00T',x,y,0.0)
call TriggerSleepAction(0.)
set i=i+1
endloop
endif
endfunction
//===========================================================================
function InitTrig_Operation_Silent_Hill takes nothing returns nothing
set gg_trg_Operation_Silent_Hill = CreateTrigger()
call TriggerAddAction(gg_trg_Operation_Silent_Hill,function OperationSilentHill)
endfunction |
|