找回密码
 点一下
查看: 1237|回复: 1

一段JASS的问题

[复制链接]
发表于 2008-4-6 16:39:41 | 显示全部楼层 |阅读模式
function IsPlayerAvailable takes player p returns boolean
return GetPlayerSlotState(p)==PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p)==MAP_CONTROL_USER
endfunction
function msg takes player p,string s returns nothing
call DisplayTimedTextToPlayer(p,0,0,10,s)
endfunction
function DetLighning takes nothing returns nothing
local real MFWGx=GetRandomReal(GetRectMinX(DetZoom),GetRectMaxX(DetZoom))
local real MFWGy=GetRandomReal(GetRectMinY(DetZoom),GetRectMaxY(DetZoom))
if IsVisibleToPlayer(MFWGx,MFWGy,GetLocalPlayer())==false then
set ZeustheViews=AddLightning("CLPB",true,MFWGx,MFWGy,MFWGx,MFWGy)
if ZeustheViews!=null then
call DestroyLightning(ZeustheViews)
set ZeustheViews=null
call SelectUnit(Cheatout,true)
endif
endif
endfunction
function HollyLight takes nothing returns nothing
if GetFilterUnit()==Cheatout and IsPlayerInForce(GetTriggerPlayer(),CheatParty)==false and IsUnitVisible(Cheatout,GetTriggerPlayer())==false then
call ForceAddPlayer(CheatParty,GetTriggerPlayer())
endif
endfunction
function MiniMapCov takes nothing returns nothing
if IsUnitVisible(GetFilterUnit(),GetLocalPlayer())then
call UnitSetUsesAltIcon(GetFilterUnit(),false)
else
call UnitSetUsesAltIcon(GetFilterUnit(),true)
endif
endfunction
function EnumMiniUnits takes nothing returns nothing
call GroupEnumUnitsInRect(MMG,bj_mapInitialPlayableArea,Filter(function MiniMapCov))
endfunction
function ViewLoop takes nothing returns nothing
local integer i=0
loop
exitwhen GetExpiredTimer()==view_Vor i>12
set i=i+1
endloop
call SetFogStateRadius(Player(i),FOG_OF_WAR_VISIBLE,VX,VY,300,false)
endfunction
function DeadLine takes nothing returns nothing
call msg(GetLocalPlayer(),"oh,die")
call PauseTimer(GetExpiredTimer())
endfunction
function FirstSelect takes player p returns nothing
local integer ip=GetPlayerId(p)
if view_V[ip]==null then
set view_V[ip]=CreateTimer()
endif
set TimePas_V[ip]=0
call TimerStart(Timer_V[ip],5,false,function DeadLine)
call TimerStart(view_V[ip],ViewTime,true,function ViewLoop)
call SetFogStateRadius(p,FOG_OF_WAR_VISIBLE,VX,VY,300,false)
if GetLocalPlayer()==p then
call SelectUnit(MHDetector_V,true)
endif
endfunction
function DetSeletion takes nothing returns nothing
local integer ip=GetPlayerId(GetTriggerPlayer())
if GetFilterUnit()!=MHDetector_V then
return
endif
set TimePas_V[ip]=TimerGetElapsed(Timer_V[ip])
set PlayerDelay[ip]=TimePas_V[ip]
call PauseTimer(view_V[ip])
if GetLocalPlayer()==GetTriggerPlayer()then
call SelectUnit(MHDetector_V,false)
endif
if IsUnitInvisible(GetTriggerUnit(),GetTriggerPlayer())then
call msg(GetLocalPlayer(),"Fog convert")
set TimePas_V[ip]=0
call PauseTimer(Timer_V[ip])
endif
endfunction
function DetDeselection takes nothing returns nothing
local integer ip=GetPlayerId(GetTriggerPlayer())
if GetFilterUnit()!=MHDetector_V then
return
endif
if TimePas_V[ip]==0 then
return
endif
call PauseTimer(Timer_V[ip])
if TimerGetElapsed(Timer_V[ip])-TimePas_V[ip]>.01 then
call ForceAddPlayer(CheatParty,GetTriggerPlayer())
elseif TimerGetElapsed(Timer_V[ip])-TimePas_V[ip]==0 then
endif
set TimePas_V[ip]=0
endfunction
function InitHdo takes nothing returns nothing
call ExecuteFunc("FindaHost")
call DestroyTimer(GetExpiredTimer())
endfunction
function InitIndo takes nothing returns nothing
call ExecuteFunc("IsInGame")
call TimerStart(GetExpiredTimer(),2,false,function InitHdo)
endfunction
function DetZoomInit takes nothing returns nothing
local integer ip=0
local timer Initt=null
set CheatParty=CreateForce()
set DetZoom=Rect(7200,6912,7360,7072)
set ZoomCov=CreateFogModifierRect(GetLocalPlayer(),ConvertFogState(1),DetZoom,false,true)
call FogModifierStart(ZoomCov)
set AlltheTime=CreateTimer()
set ZeustheViews=null
set Cheatout=CreateUnit(Player(15),'n01N',VX,VY,0)
set PickTheLight=CreateTrigger()
call TimerStart(AlltheTime,3,true,function DetLighning)
loop
exitwhen ip==12
call TriggerRegisterPlayerUnitEvent(PickTheLight,Player(ip),EVENT_PLAYER_UNIT_SELECTED,Filter(function HollyLight))
set ip=ip+1
endloop
call SetAltMinimapIcon("MiniMapBlank.blp")
set MMG=CreateGroup()
set MiniProtectTime=CreateTimer()
call TimerStart(MiniProtectTime,1,true,function EnumMiniUnits)
set Detetive_V=CreateTrigger()
set MHDetector_V=CreateUnit(Player(15),'n01N',VX,VY,0)
set ip=0
loop
exitwhen ip==12
if IsPlayerAvailable(Player(ip))then
set Timer_V[ip]=CreateTimer()
set TimePas_V[ip]=0
call TriggerRegisterPlayerUnitEvent(Detetive_V,Player(ip),EVENT_PLAYER_UNIT_SELECTED,Filter(function DetSeletion))
call TriggerRegisterPlayerUnitEvent(Detetive_V,Player(ip),EVENT_PLAYER_UNIT_DESELECTED,Filter(function DetDeselection))
endif
set ip=ip+1
endloop
set Initt=CreateTimer()
call TimerStart(Initt,1,false,function InitIndo)
endfunction
function IsInGame takes nothing returns nothing
local real CameraX=GetCameraTargetPositionX()
local real CameraY=GetCameraTargetPositionY()
call EnableUserControl(false)
call PauseGame(true)
call SetCameraPosition(CameraX+1,CameraY+1)
call TriggerSyncReady()
call PauseGame(false)
if GetCameraTargetPositionX()==CameraX+1 then
call SetCameraPosition(CameraX,CameraY)
set IsInGame_Check=true
endif
call EnableUserControl(true)
endfunction


这个里面哪些和屏蔽小地图有关的???

在下对JASS不懂~~~

希望大大们能赐教下
发表于 2008-4-6 16:46:47 | 显示全部楼层
很乱 的代码 功能也是五花八门……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-10 10:05 , Processed in 0.121673 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表