Log in
Current Version: v0.0.01A
Alpha version
Changelogs to come
Latest topics
Version Progress
Changes for v0.02.0A||||||||||||||||||||[●] [general]
||||||||||||||||||||[●] [Heroes]
||||||||||||||||||||[●] [Items]
||||||||||||||||||||[●] [Bugs]
||||||||||||||||||||[●] [Total]
creep defense and such
Page 1 of 1
creep defense and such
protect friendlies
and the functions SameTeam and PlayerForceById
- Code:
function Trig_Protect_Friendly_Conditions takes nothing returns boolean
return SameTeam(GetTriggerUnit(), GetAttacker())
endfunction
function Trig_Protect_Friendly_Actions takes nothing returns nothing
if GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) > 150 then
call IssueImmediateOrderById(GetAttacker(), OrderId("stop"))
endif
endfunction
//===========================================================================
function InitTrig_Protect_Friendly takes nothing returns nothing
set gg_trg_Protect_Friendly = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Protect_Friendly, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Protect_Friendly, Condition( function Trig_Protect_Friendly_Conditions ) )
call TriggerAddAction( gg_trg_Protect_Friendly, function Trig_Protect_Friendly_Actions )
endfunction
and the functions SameTeam and PlayerForceById
- Code:
function PlayerForceById takes integer i returns integer
if IsPlayerInForce(Player(i), udg_team[1]) then
return 0
elseif IsPlayerInForce(Player(i), udg_team[2]) then
return 1
endif
return 3
endfunction
- Code:
function SameTeam takes unit u, unit v returns boolean
return PlayerForceById(GetPlayerId(GetOwningPlayer(u))) == PlayerForceById(GetPlayerId(GetOwningPlayer(v)))
endfunction
_________________
warning! very-stubborn, sarcastic, self-important, argumentative developer detected!
And unto the masses, He doth spoke:
"Behold The Stuff! It Is Good!"
And the Stuff was good.
Heroes:
Commander Farsight (colab - implemented) - Ku'gaath Plaguefather(incomplete) - Ilyana Arienal(incomplete) - Harlequin Shadowseer(incomplete) - Modular Tau Battlesuit(sandbox)

» Petroff's Defense - Powerbook 2011 (ctg)
» Understanding The King's Indian Attack
» Prime Drop Locations
» Aleknine's Defense Powerbook
» Komodo 9.1 64-bit 8CPU v Stockfish 290615 64-bit 8CPU Match
» Understanding The King's Indian Attack
» Prime Drop Locations
» Aleknine's Defense Powerbook
» Komodo 9.1 64-bit 8CPU v Stockfish 290615 64-bit 8CPU Match
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
» Faction creeps
» [SCII] [Inquisition] Hector Rex
» [necrons] Orikan, the Diviner
» Talent System
» Capture Points system
» [SCII] [Orks] Warboss(es)
» Game Guide
» [Inquisition] Mordrak
» [inquiition] Kaldor Draigo