Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- bomb, code for inventory
- local bombLoc = "Bomb AoE"
- bombDC = Deaths( )
- bombDC:SetUnit( "Terran Missile Turret" )
- bombDC:SetPlayer( 8 )
- local bombCountDC = Deaths( )
- bombCountDC:SetUnit( "Terran Nuclear Silo" )
- bombCountDC:SetPlayer( 8 )
- -- TESTING PURPOSES
- -- start the player out with some bombs
- p1:Conditions( )
- Always( )
- p1:Actions( )
- bombCountDC:SetCount( 3 )
- bombCountDC:SetTo( )
- -- if player has bombs (bombCountDC), then setup bombDC and play effects
- p1:Conditions( )
- BringExactly( Player1, "Gui Montag (Firebat)", "Bomb", 0 )
- bombCountDC:SetCount( 1 )
- bombCountDC:AtLeast( )
- p1:Actions( )
- MoveUnit( Player1, "Gui Montag (Firebat)", 1, "Anywhere", "Bomb" )
- PlayWAV( "staredit/wav/LTTP_Bomb_Drop.wav" )
- Text( "<4>Bomb" )
- bombDC:SetCount( 12 * 5 )
- bombDC:Add( )
- bombCountDC:SetCount( 1 )
- bombCountDC:Subtract( )
- Preserve( )
- -- else player does NOT have bombs (bombCountDC)
- p1:Conditions( )
- BringExactly( Player1, "Gui Montag (Firebat)", "Bomb", 0 )
- bombCountDC:SetCount( 0 )
- bombCountDC:Exactly( )
- p1:Actions( )
- MoveUnit( Player1, "Gui Montag (Firebat)", 1, "Anywhere", "Bomb" )
- Text( "<4>Out of bombs" )
- PlayWAV( "staredit/wav/LTTP_Error.wav" )
- Preserve( )
- -- detect if player tried to spawn 2 bombs at once
- -- do this by subtracting the timer counter (implements a modulo)
- p8:Conditions( )
- bombDC:SetCount( 12 * 5 + 1 )
- bombDC:AtLeast( )
- p8:Actions( )
- bombDC:SetCount( 12 * 5 )
- bombDC:Subtract( )
- Preserve( )
- -- detect if no bomb exists, if so create one
- p8:Conditions( )
- bombDC:SetCount( 1 )
- bombDC:AtLeast( )
- BringExactly( 8, "Magellan (Science Vessel)", "Anywhere", 0 )
- p8:Actions( )
- CenterLocation( bombLoc, 1, LINK, "Anywhere" )
- CreateUnit( 8, "Magellan (Science Vessel)", count, bombLoc )
- SetInvincibility( 8, "Magellan (Science Vessel)", bombLoc, "enabled" )
- Preserve( )
- -- explode the bomb
- -- this should signify when to kill enemies and watnot
- p8:Conditions( )
- bombDC:SetCount( 1 )
- bombDC:Exactly( )
- p8:Actions( )
- KillUnit( 8, "Magellan (Science Vessel)" )
- Preserve( )
- -- play the bomb sound for player 1
- p1:Conditions( )
- bombDC:SetCount( 1 )
- bombDC:Exactly( )
- p1:Actions( )
- PlayWAV( "staredit/wav/LTTP_Bomb_Blow.wav" )
- Preserve( )
- -- blow up any rhynadons
- -- Rhynadon (Badlands)
- p8:Conditions( )
- bombDC:SetCount( 1 )
- bombDC:Exactly( )
- BringAtLeast( 8, "Rhynadon (Badlands)", bombLoc, 1 )
- p8:Actions( )
- KillUnitAt( 8, "Rhynadon (Badlands)", 1, bombLoc )
- Preserve( )
- -- blow up scantids
- p8:Conditions( )
- bombDC:SetCount( 1 )
- bombDC:Exactly( )
- BringAtLeast( 8, "Scantid (Desert)", bombLoc, 1 )
- p8:Actions( )
- KillUnitAt( 8, "Scantid (Desert)", 0, bombLoc )
- Preserve( )
- -- countdown the bomb dc
- p8:Conditions( )
- bombDC:SetCount( 1 )
- bombDC:AtLeast( )
- p8:Actions( )
- bombDC:Subtract( )
- Preserve( )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement