share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 6819 07e8de67c3c2
parent 6253 d73317579ae4
child 7135 4d863aadd0b2
equal deleted inserted replaced
6818:136aa9c8c593 6819:07e8de67c3c2
     3 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
     3 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
     4 
     4 
     5 ---------------------------------------------------
     5 ---------------------------------------------------
     6 ---------------------------------------------------
     6 ---------------------------------------------------
     7 ---------------------------------------------------
     7 ---------------------------------------------------
     8 --- Space Invasion Code Follows (1.0)
     8 --- Space Invasion Code Follows (1.1)
     9 ---------------------------------------------------
     9 ---------------------------------------------------
    10 ---------------------------------------------------
    10 ---------------------------------------------------
    11 -- VERSION HISTORY
    11 -- VERSION HISTORY
    12 ----------------
    12 ----------------
    13 -- version 0.1
    13 -- version 0.1
   123 -- bugfix and balance for multishot
   123 -- bugfix and balance for multishot
   124 
   124 
   125 ------------------------
   125 ------------------------
   126 -- version 1.0
   126 -- version 1.0
   127 ------------------------
   127 ------------------------
   128 
       
   129 -- if only version numbers actually worked like this, wouldn't that be awful :D
   128 -- if only version numbers actually worked like this, wouldn't that be awful :D
   130 
       
   131 -- added surfer achievement
   129 -- added surfer achievement
   132 -- increased value of shield miser by 1 point per kill (OP?)
   130 -- increased value of shield miser by 1 point per kill (OP?)
   133 
   131 
       
   132 ------------------------
       
   133 -- version 1.1
       
   134 ------------------------
       
   135 -- fixed radar so that blips dont go past circs when you get very close
       
   136 -- added a missing loc for shield depletion
       
   137 -- increased delay to 1000 to try stop noobies missing their turn
       
   138 -- added sniper achievement for hits from over a 1000000 away
       
   139 -- added achievement for 3 "sniper" shots in a round
       
   140 -- added achievement for 3 "point blank" shots in a round
       
   141 -- added "fierce Competition" achievement for shooting an enemy hog (once per round)
       
   142 -- some support for more weapons later
   134 
   143 
   135 --------------------------
   144 --------------------------
   136 --notes for later
   145 --notes for later
   137 --------------------------
   146 --------------------------
   138 -- maybe add a check for a tie, NAH
   147 -- maybe add a check for a tie, IMPOSSIBRU THERE ARE NO TIES
   139 -- more achievements? (3 kamikazes in a row, long distance shooter, supreme shield expert/miser etc?)
   148 -- more achievements? (3 kamikazes in a row, supreme shield expert/miser etc?)
       
   149 
       
   150 -- if more weps are added, replace primshotsfired all over the place
       
   151 
       
   152 -- look for derp and let invaders shoot again
       
   153 
       
   154 -- more weps? flamer/machineballgun,
       
   155 -- some kind of bomb that just drops straight down
       
   156 -- "fire and forget" missile
       
   157 -- shockwave
       
   158 
       
   159 -- some kind of ability-meter that lets you do something awesome when you are
       
   160 -- doing really well in a given round.
       
   161 -- probably new kind of shield that pops any invaders who come near
       
   162 
       
   163 -- fix game never ending bug
       
   164 -- fix radar
       
   165 -- new invader: golden snitch, doesn't show up on your radar
       
   166 
       
   167 -- maybe replace (48/100*vCircRadius[i])/2 with something better
       
   168 
   140 
   169 
   141 --[[CAPTION CATEGORIES
   170 --[[CAPTION CATEGORIES
   142 -----------------
   171 -----------------
   143 capgrpGameState
   172 capgrpGameState
   144 -----------------
   173 -----------------
   145 
   174 AddCaption(LOC_NOT("Sniper!") .. " +10 " .. LOC_NOT("points") .. "!",0xffba00ff,capgrpAmmostate)
       
   175 --they call me bullsye
       
   176 --point blank combo
       
   177 --fierce Competition
   146 -----------------
   178 -----------------
   147 capgrpAmmostate
   179 capgrpAmmostate
   148 -----------------
   180 -----------------
   149 AddCaption( chainLength .. LOC_NOT("-chain! +") .. chainLength*2 .. LOC_NOT(" points!"),0xffba00ff,capgrpAmmostate)
   181 AddCaption( chainLength .. LOC_NOT("-chain! +") .. chainLength*2 .. LOC_NOT(" points!"),0xffba00ff,capgrpAmmostate)
   150 AddCaption(LOC_NOT("Multi-shot! +15 points!"),0xffba00ff,capgrpAmmostate)
   182 AddCaption(LOC_NOT("Multi-shot! +15 points!"),0xffba00ff,capgrpAmmostate)
   160 -----------------
   192 -----------------
   161 AddCaption(LOC_NOT("Boom! +25 points!"),0xffba00ff,capgrpVolume)
   193 AddCaption(LOC_NOT("Boom! +25 points!"),0xffba00ff,capgrpVolume)
   162 AddCaption(LOC_NOT("BOOM! +50 points!"),0xffba00ff,capgrpVolume)
   194 AddCaption(LOC_NOT("BOOM! +50 points!"),0xffba00ff,capgrpVolume)
   163 AddCaption(LOC_NOT("BOOM! BOOM! BOOM! +100 points!"),0xffba00ff,capgrpVolume)
   195 AddCaption(LOC_NOT("BOOM! BOOM! BOOM! +100 points!"),0xffba00ff,capgrpVolume)
   164 AddCaption(LOC_NOT("Accuracy Bonus! +15 points!"),0xffba00ff,capgrpVolume)
   196 AddCaption(LOC_NOT("Accuracy Bonus! +15 points!"),0xffba00ff,capgrpVolume)
   165 AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
   197 AddCaption(LOC_NOT("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
   166 
   198 
   167 -----------------
   199 -----------------
   168 capgrpMessage
   200 capgrpMessage
   169 -----------------
   201 -----------------
   170 AddCaption(LOC_NOT("Ammo Depleted!"),0xff0000ff,capgrpMessage)
   202 AddCaption(LOC_NOT("Ammo Depleted!"),0xff0000ff,capgrpMessage)
   171 AddCaption(LOC_NOT("Ammo: ") .. primShotsLeft)
   203 AddCaption(LOC_NOT("Ammo: ") .. primShotsLeft)
   172 AddCaption("Shield Depleted",0xff0000ff,capgrpMessage)
   204 AddCaption(LOC_NOT("Shield Depleted"),0xff0000ff,capgrpMessage)
   173 AddCaption( LOC_NOT("Shield ON:") .. " " .. shieldHealth - 80 .. " " .. LOC_NOT("Power Remaining") )
   205 AddCaption( LOC_NOT("Shield ON:") .. " " .. shieldHealth - 80 .. " " .. LOC_NOT("Power Remaining") )
   174 AddCaption(LOC_NOT("Shield OFF:") .. " " .. shieldHealth - 80 .. " " .. LOC_NOT("Power Remaining") )
   206 AddCaption(LOC_NOT("Shield OFF:") .. " " .. shieldHealth - 80 .. " " .. LOC_NOT("Power Remaining") )
   175 
   207 
   176 AddCaption(LOC_NOT("Time Extended!") .. "+" .. 4 .. LOC_NOT("s"), 0xff0000ff,capgrpMessage )
   208 AddCaption(LOC_NOT("Time Extended!") .. "+" .. 4 .. LOC_NOT("s"), 0xff0000ff,capgrpMessage )
   177 AddCaption("+" .. 3 .. " " .. LOC_NOT("Ammo"), 0x00ff00ff,capgrpMessage)
   209 AddCaption("+" .. 3 .. " " .. LOC_NOT("Ammo"), 0x00ff00ff,capgrpMessage)
   204 local shellID = 0
   236 local shellID = 0
   205 local explosivesID = 0
   237 local explosivesID = 0
   206 local luaGameTicks = 0
   238 local luaGameTicks = 0
   207 
   239 
   208 -- gaudyRacer
   240 -- gaudyRacer
       
   241 local boosterOn = false
   209 local roundLimit = 3	-- no longer set here (see version history)
   242 local roundLimit = 3	-- no longer set here (see version history)
   210 local roundNumber = 0
   243 local roundNumber = 0
   211 local firstClan = 10
   244 local firstClan = 10
   212 local gameOver = false
   245 local gameOver = false
   213 local gameBegun = false
   246 local gameBegun = false
   250 local GK = 0
   283 local GK = 0
   251 local BK = 0
   284 local BK = 0
   252 local OK = 0
   285 local OK = 0
   253 local SK = 0
   286 local SK = 0
   254 local shieldMiser = true
   287 local shieldMiser = true
       
   288 local fierceComp = false
   255 local chainCounter = 0
   289 local chainCounter = 0
   256 local chainLength = 0
   290 local chainLength = 0
   257 local shotsFired = 0
   291 local shotsFired = 0
   258 local shotsHit = 0
   292 local shotsHit = 0
   259 local SurfTime = 0
   293 local SurfTime = 0
   260 
   294 local sniperHits = 0
       
   295 local pointBlankHits = 0
   261 ---------------------
   296 ---------------------
   262 -- tumbler goods
   297 -- tumbler goods
   263 ---------------------
   298 ---------------------
   264 
   299 
   265 local moveTimer = 0
   300 local moveTimer = 0
   266 local leftOn = false
   301 local leftOn = false
   267 local rightOn = false
   302 local rightOn = false
   268 local upOn = false
   303 local upOn = false
   269 local downOn = false
   304 local downOn = false
   270 
   305 
       
   306 ----------------
       
   307 -- TUMBLER
       
   308 local wep = {}
       
   309 local wepAmmo = {}
       
   310 local wepCol = {}
       
   311 local wepIndex = 0
       
   312 local wepCount = 0
       
   313 local fireTimer = 0
       
   314 ----------------
       
   315 
       
   316 
       
   317 
   271 local primShotsMax = 5
   318 local primShotsMax = 5
   272 local primShotsLeft = 0
   319 local primShotsLeft = 0
   273 
   320 
   274 local TimeLeftCounter = 0
   321 local TimeLeftCounter = 0
   275 local TimeLeft = 0
   322 local TimeLeft = 0
   277 local tumbleStarted = false
   324 local tumbleStarted = false
   278 
   325 
   279 local beam = false
   326 local beam = false
   280 local pShield
   327 local pShield
   281 local shieldHealth
   328 local shieldHealth
       
   329 
       
   330 local shockwave
       
   331 local shockwaveHealth = 0
       
   332 local shockwaveRad = 300
   282 
   333 
   283 local Timer100 = 0
   334 local Timer100 = 0
   284 
   335 
   285 local vTag = {}
   336 local vTag = {}
   286 
   337 
   360 		tValue = TimeLeft
   411 		tValue = TimeLeft
   361 	elseif i == 1 then
   412 	elseif i == 1 then
   362 		zoomL = 1.1
   413 		zoomL = 1.1
   363 		yOffset = 70
   414 		yOffset = 70
   364 		tCol = 0x00ff00ff
   415 		tCol = 0x00ff00ff
   365 		tValue = primShotsLeft
   416 		tValue = wepAmmo[wepIndex] --primShotsLeft
   366 	elseif i == 2 then
   417 	elseif i == 2 then
   367 		zoomL = 1.1
   418 		zoomL = 1.1
   368 		xOffset = 40 + 35
   419 		xOffset = 40 + 35
   369 		yOffset = 70
   420 		yOffset = 70
   370 		tCol = 0xa800ffff
   421 		tCol = 0xa800ffff
   638 		lfs = 50	-- roughly 5 seconds
   689 		lfs = 50	-- roughly 5 seconds
   639 		shellID = shellID + 1
   690 		shellID = shellID + 1
   640 		setGearValue(gear,"ID",shellID)
   691 		setGearValue(gear,"ID",shellID)
   641 		--nw WriteLnToConsole("Just assigned ID " .. getGearValue(gear,"ID") .. " to this shell")
   692 		--nw WriteLnToConsole("Just assigned ID " .. getGearValue(gear,"ID") .. " to this shell")
   642 	elseif GetGearType(gear) == gtBall then
   693 	elseif GetGearType(gear) == gtBall then
   643 		lfs = 70	-- 7s
   694 		lfs = 5 --70	-- 7s
   644 	elseif GetGearType(gear) == gtExplosives then
   695 	elseif GetGearType(gear) == gtExplosives then
   645 		lfs = 15	-- 1.5s
   696 		lfs = 15	-- 1.5s
   646 		explosivesID = explosivesID + 1
   697 		explosivesID = explosivesID + 1
   647 		setGearValue(gear,"ID",explosivesID)
   698 		setGearValue(gear,"ID",explosivesID)
       
   699 		setGearValue(gear,"XP", GetX(gear))
       
   700 		setGearValue(gear,"YP", GetY(gear))
   648 		--nw WriteLnToConsole("Just assigned ID " .. getGearValue(gear,"ID") .. " to this explosives")
   701 		--nw WriteLnToConsole("Just assigned ID " .. getGearValue(gear,"ID") .. " to this explosives")
   649 	elseif GetGearType(gear) == gtFlame then
   702 	elseif GetGearType(gear) == gtFlame then
   650 		lfs = 5	-- 0.5s
   703 		lfs = 5	-- 0.5s
   651 	else
   704 	else
   652 		lfs = 100
   705 		lfs = 100
   708 -----------------------
   761 -----------------------
   709 --EVENT HANDLERS
   762 --EVENT HANDLERS
   710 -- action keys
   763 -- action keys
   711 -----------------------
   764 -----------------------
   712 
   765 
       
   766 function HandleFlameThrower()
       
   767 
       
   768 	--
       
   769 	--flamer
       
   770 
       
   771 	fireTimer = fireTimer + 1
       
   772 	if fireTimer == 6 then	-- 6
       
   773 		fireTimer = 0
       
   774 
       
   775 		if (wep[wepIndex] == loc("Flamer") ) and (preciseOn == true) and (wepAmmo[wepIndex] > 0) and (stopMovement == false) and (tumbleStarted == true) then
       
   776 
       
   777 			wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
       
   778 			AddCaption(
       
   779 			loc("Flamer") .. ": " ..
       
   780 			(wepAmmo[wepIndex]/800*100) - (wepAmmo[wepIndex]/800*100)%2 .. "%",
       
   781 			wepCol[2],
       
   782 			capgrpMessage2
       
   783 			)
       
   784 			DrawTag(3)
       
   785 
       
   786 			dx, dy = GetGearVelocity(CurrentHedgehog)					--gtFlame -- gtSnowball -- gtAirBomb
       
   787 			shell = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtFlame, 0, 0, 0, 0)
       
   788 
       
   789 			xdev = 1 + GetRandom(35)	--25
       
   790 			xdev = xdev / 100
       
   791 
       
   792 			r = GetRandom(2)
       
   793 			if r == 1 then
       
   794 				xdev = xdev*-1
       
   795 			end
       
   796 
       
   797 			ydev = 1 + GetRandom(35)	--25
       
   798 			ydev = ydev / 100
       
   799 
       
   800 			r = GetRandom(2)
       
   801 			if r == 1 then
       
   802 				ydev = ydev*-1
       
   803 			end
       
   804 
       
   805 								--4.5	or 2.5 nonflames				--4.5
       
   806 			SetGearVelocity(shell, (dx*4.5)+(xdev*fMod), (dy*4.5)+(ydev*fMod))	--10
       
   807 
       
   808 		end
       
   809 
       
   810 	end
       
   811 
       
   812 
       
   813 end
       
   814 
       
   815 function ChangeWeapon()
       
   816 
       
   817 	wepIndex = wepIndex + 1
       
   818 	if wepIndex == wepCount then
       
   819 		wepIndex = 0
       
   820 	end
       
   821 
       
   822 	AddCaption(wep[wepIndex] .. " " .. loc("selected!"), wepCol[wepIndex],capgrpAmmoinfo )
       
   823 	AddCaption(wepAmmo[wepIndex] .. " " .. loc("shots remaining."), wepCol[wepIndex],capgrpMessage2)
       
   824 
       
   825 end
       
   826 
       
   827 --function onTimer()
       
   828 
       
   829 	-- experimental wep
       
   830 	--[[SetVisualGearValues(shockwave, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, 300, 1, 0xff33ffff)
       
   831 	AddCaption("boom")
       
   832 	PlaySound(sndWarp)
       
   833 	shockwaveHealth = 100
       
   834 	shockwaveRad = 100]]
       
   835 
       
   836 
       
   837 	--change wep
       
   838 	--ChangeWeapon()
       
   839 
       
   840 	-- booster
       
   841 	--[[if boosterOn == false then
       
   842 		boosterOn = true
       
   843 	else
       
   844 		boosterOn = false
       
   845 	end]]
       
   846 
       
   847 --end
       
   848 
   713 -- o rite dis wan iz liek synched n stuff hope full lee
   849 -- o rite dis wan iz liek synched n stuff hope full lee
   714 function onPrecise()
   850 -- old method
   715 
   851 --[[function onPrecise()
   716 	--WriteLnToConsole("onPrecise event handler at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
   852 
   717 
   853 
   718 	-- Fire Barrel
   854 	-- Fire Barrel
   719 	if (primShotsLeft > 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
   855 	if (primShotsLeft > 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
   720 
   856 
   721 		shotsFired = shotsFired +1
   857 		shotsFired = shotsFired +1
   732 		end
   868 		end
   733 		DrawTag(1)
   869 		DrawTag(1)
   734 
   870 
   735 		CopyPV(CurrentHedgehog, morte) -- new addition
   871 		CopyPV(CurrentHedgehog, morte) -- new addition
   736 		x,y = GetGearVelocity(morte)
   872 		x,y = GetGearVelocity(morte)
   737 		--WriteLnToConsole("I'm going to shoot a barrel so I just got the velocity of currenthedgehog. It is dx: " .. x .. "; dy: " .. y)
       
   738 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
       
   739 
       
   740 
       
   741 
   873 
   742 		x = x*2
   874 		x = x*2
   743 		y = y*2
   875 		y = y*2
   744 		SetGearVelocity(morte, x, y)
   876 		SetGearVelocity(morte, x, y)
   745 
   877 
   746 		--WriteLnToConsole("I just SET the velocity of a barrel I created. It is now dx: " .. x .. "; dy: " .. y)
       
   747 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
       
   748 
       
   749 
       
   750 
   878 
   751 	elseif (primShotsLeft == 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
   879 	elseif (primShotsLeft == 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
   752 		AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
   880 		AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
   753 	end
   881 	end
   754 
   882 
   755 
   883 
       
   884 end]]
       
   885 
       
   886 -- derp tumbler
       
   887 function onPrecise()
       
   888 
       
   889 	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) and (wepAmmo[wepIndex] > 0) then
       
   890 
       
   891 		wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
       
   892 		--AddCaption(wepAmmo[wepIndex] .. " " .. loc("shots remaining."), wepCol[wepIndex],capgrpMessage2)
       
   893 
       
   894 		if wep[wepIndex] == loc("Barrel Launcher") then
       
   895 			shotsFired = shotsFired +1
       
   896 
       
   897 			morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtExplosives, 0, 0, 0, 1)
       
   898 			CopyPV(CurrentHedgehog, morte) -- new addition
       
   899 			x,y = GetGearVelocity(morte)
       
   900 			x = x*2
       
   901 			y = y*2
       
   902 			SetGearVelocity(morte, x, y)
       
   903 
       
   904 			if wepAmmo[wepIndex] == 0 then
       
   905 			PlaySound(sndSuddenDeath)
       
   906 			AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
       
   907 			else
       
   908 				--AddCaption(loc("Ammo") .. ": " .. wepAmmo[wepIndex])
       
   909 			end
       
   910 			DrawTag(1)
       
   911 
       
   912 		elseif wep[wepIndex] == loc("Mine Deployer") then
       
   913 			morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtAirBomb, 0, 0, 0, 0)
       
   914 			SetTimer(morte, 1000)
       
   915 			DrawTag(1)
       
   916 		end
       
   917 
       
   918 	elseif (wepAmmo[wepIndex] == 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
       
   919 		AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
       
   920 	end
       
   921 
       
   922 	preciseOn = true
       
   923 
       
   924 end
       
   925 
       
   926 function onPreciseUp()
       
   927 	preciseOn = false
   756 end
   928 end
   757 
   929 
   758 function onLJump()
   930 function onLJump()
   759 
   931 
   760 	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
   932 	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
   761 		shieldMiser = false
   933 		shieldMiser = false
   762 		if shieldHealth == 80 then
   934 		if shieldHealth == 80 then
   763 			AddCaption("Shield Depleted",0xff0000ff,capgrpMessage)
   935 			AddCaption(loc("Shield Depleted"),0xff0000ff,capgrpMessage)
   764 			PlaySound(sndMineTick)
   936 			PlaySound(sndMineTick)
   765 			PlaySound(sndSwitchHog)
   937 			PlaySound(sndSwitchHog)
   766 		elseif (beam == false) and (shieldHealth > 80) then
   938 		elseif (beam == false) and (shieldHealth > 80) then
   767 			beam = true
   939 			beam = true
   768 			SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, 300, 1, 0xa800ffff)
   940 			SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, 300, 1, 0xa800ffff)
   833 	Theme = "EarthRise"
  1005 	Theme = "EarthRise"
   834 	CaseFreq = 0
  1006 	CaseFreq = 0
   835 	HealthCaseProb = 0
  1007 	HealthCaseProb = 0
   836 	MinesNum = 0
  1008 	MinesNum = 0
   837 	Explosives = 0
  1009 	Explosives = 0
       
  1010 	Delay = 1000
   838 
  1011 
   839 	for i = 0, 3 do
  1012 	for i = 0, 3 do
   840 		vTag[0] = AddVisualGear(0, 0, vgtHealthTag, 0, false)
  1013 		vTag[0] = AddVisualGear(0, 0, vgtHealthTag, 0, false)
   841 	end
  1014 	end
   842 
  1015 
   843 	HideTags()
  1016 	HideTags()
       
  1017 
       
  1018 	wep[0] = loc("Barrel Launcher")
       
  1019 	wep[1] = loc("Mine Deployer")
       
  1020 	wep[2] = loc("Flamer")
       
  1021 
       
  1022 	wepCol[0] = 0x78818eff
       
  1023 	wepCol[1] = 0xa12a77ff
       
  1024 	wepCol[2] = 0xf49318ff
       
  1025 
       
  1026 	wepCount = 3
   844 
  1027 
   845 end
  1028 end
   846 
  1029 
   847 function onGameStart()
  1030 function onGameStart()
   848 
  1031 
   896 
  1079 
   897 end
  1080 end
   898 
  1081 
   899 function onNewTurn()
  1082 function onNewTurn()
   900 
  1083 
   901 	primShotsLeft = primShotsMax
  1084 	--primShotsLeft = primShotsMax
   902 	radShotsLeft = 2
  1085 	radShotsLeft = 2
   903 	stopMovement = false
  1086 	stopMovement = false
   904 	tumbleStarted = false
  1087 	tumbleStarted = false
       
  1088 	boosterOn = false
   905 	beam = false
  1089 	beam = false
   906 	shieldHealth = 30 + 80 -- 50 = 5 secs, roughly
  1090 	shieldHealth = 30 + 80 -- 50 = 5 secs, roughly
       
  1091 	shockwaveHealth = 0
   907 
  1092 
   908 	RK = 0
  1093 	RK = 0
   909 	GK = 0
  1094 	GK = 0
   910 	BK = 0
  1095 	BK = 0
   911 	OK = 0
  1096 	OK = 0
   912 	SK = 0
  1097 	SK = 0
   913 	roundKills = 0
  1098 	roundKills = 0
   914 	shieldMiser = true
  1099 	shieldMiser = true
       
  1100 	fierceComp = false
   915 	shotsFired = 0
  1101 	shotsFired = 0
   916 	shotsHit = 0
  1102 	shotsHit = 0
       
  1103 	sniperHits = 0
       
  1104 	pointBlankHits = 0
   917 	chainLength = 0
  1105 	chainLength = 0
   918 	chainCounter = 0
  1106 	chainCounter = 0
   919 	SurfTime = 12
  1107 	SurfTime = 12
   920 
  1108 
   921 	-------------------------
  1109 	-------------------------
   935 		stopMovement = true
  1123 		stopMovement = true
   936 		tumbleStarted = false
  1124 		tumbleStarted = false
   937 		SetMyCircles(false)
  1125 		SetMyCircles(false)
   938 	end
  1126 	end
   939 
  1127 
       
  1128 
       
  1129 	-------
       
  1130 	-- tumbler
       
  1131 	----
       
  1132 
       
  1133 	wepAmmo[0] = 5
       
  1134 	wepAmmo[1] = 2
       
  1135 	wepAmmo[2] = 5000
       
  1136 	wepIndex = 2
       
  1137 	ChangeWeapon()
       
  1138 
       
  1139 
   940 	HideTags()
  1140 	HideTags()
   941 
  1141 
   942 	---------------
  1142 	---------------
   943 	---------------
  1143 	---------------
   944 	--AddCaption("num g: " .. numGears() )
  1144 	--AddCaption("num g: " .. numGears() )
   945 
       
   946 	--WriteLnToConsole("onNewTurn, I just set a bunch of variables to their necessary states. This was done at:")
  1145 	--WriteLnToConsole("onNewTurn, I just set a bunch of variables to their necessary states. This was done at:")
   947 	--WriteLnToConsole("The above occured at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1146 	--WriteLnToConsole("The above occured at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
   948 
  1147 
   949 end
  1148 end
   950 
  1149 
   966 
  1165 
   967 	--WriteLnToConsole("Start of GameTick")
  1166 	--WriteLnToConsole("Start of GameTick")
   968 	luaGameTicks = luaGameTicks + 1 -- GameTime
  1167 	luaGameTicks = luaGameTicks + 1 -- GameTime
   969 
  1168 
   970 	HandleCircles()
  1169 	HandleCircles()
       
  1170 
       
  1171 	-- derp
       
  1172 	--if shockwaveHealth > 0 then
       
  1173 	--	shockwaveHealth = shockwaveHealth - 1
       
  1174 	--	shockwaveRad = shockwaveRad + 5
       
  1175 	--end
       
  1176 
   971 
  1177 
   972 	Timer100 = Timer100 + 1
  1178 	Timer100 = Timer100 + 1
   973 	if Timer100 >= 100 then
  1179 	if Timer100 >= 100 then
   974 		Timer100 = 0
  1180 		Timer100 = 0
   975 
  1181 
   981 				AddCaption(loc("Shield Depleted"),0xff0000ff,capgrpMessage)
  1187 				AddCaption(loc("Shield Depleted"),0xff0000ff,capgrpMessage)
   982 				PlaySound(sndMineTick)
  1188 				PlaySound(sndMineTick)
   983 				PlaySound(sndSwitchHog)
  1189 				PlaySound(sndSwitchHog)
   984 			end
  1190 			end
   985 		end
  1191 		end
       
  1192 
   986 
  1193 
   987 
  1194 
   988 		--nw WriteLnToConsole("Starting ThingsToBeRunOnGears()")
  1195 		--nw WriteLnToConsole("Starting ThingsToBeRunOnGears()")
   989 
  1196 
   990 		runOnGears(ThingsToBeRunOnGears)
  1197 		runOnGears(ThingsToBeRunOnGears)
  1061 		--WriteLnToConsole("successfully checked playerIsFine")
  1268 		--WriteLnToConsole("successfully checked playerIsFine")
  1062 
  1269 
  1063 		if (TimeLeft == 0) then
  1270 		if (TimeLeft == 0) then
  1064 			if (stopMovement == false) then	--time to stop the player
  1271 			if (stopMovement == false) then	--time to stop the player
  1065 				stopMovement = true
  1272 				stopMovement = true
       
  1273 				boosterOn = false
  1066 				beam = false
  1274 				beam = false
  1067 				upOn = false
  1275 				upOn = false
  1068 				down = false
  1276 				down = false
  1069 				leftOn = false
  1277 				leftOn = false
  1070 				rightOn = false
  1278 				rightOn = false
  1146 				dx, dy = GetGearVelocity(CurrentHedgehog)
  1354 				dx, dy = GetGearVelocity(CurrentHedgehog)
  1147 
  1355 
  1148 				--WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy)
  1356 				--WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy)
  1149 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1357 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1150 
  1358 
  1151 
  1359 				if boosterOn == true then
  1152 				dxlimit = 0.4*fMod
  1360 					tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtDust, 0, false)
  1153 				dylimit = 0.4*fMod
  1361 					g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
       
  1362 					SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, 1, g9, GetClanColor(GetHogClan(CurrentHedgehog)) )
       
  1363 					dxlimit = 0.8*fMod
       
  1364 					dylimit = 0.8*fMod
       
  1365 				else
       
  1366 					dxlimit = 0.4*fMod
       
  1367 					dylimit = 0.4*fMod
       
  1368 				end
  1154 
  1369 
  1155 				if dx > dxlimit then
  1370 				if dx > dxlimit then
  1156 					dx = dxlimit
  1371 					dx = dxlimit
  1157 				end
  1372 				end
  1158 				if dy > dylimit then
  1373 				if dy > dylimit then
  1186 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1401 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1187 				--nw WriteLnToConsole("End of Player MoveTimer")
  1402 				--nw WriteLnToConsole("End of Player MoveTimer")
  1188 
  1403 
  1189 			end
  1404 			end
  1190 
  1405 
       
  1406 
       
  1407 			HandleFlameThrower()
       
  1408 
       
  1409 
  1191 		end -- new end I put here to check if he's still alive or not
  1410 		end -- new end I put here to check if he's still alive or not
  1192 
  1411 
  1193 	end
  1412 	end
  1194 
  1413 
  1195 	--WriteLnToConsole("End of GameTick")
  1414 	--WriteLnToConsole("End of GameTick")
  1196 
  1415 
       
  1416 end
       
  1417 
       
  1418 function onGearDamage(gear, damage)
       
  1419 	if GetGearType(gear) == gtHedgehog then
       
  1420 		if (fierceComp == false) and (damage >= 60) and (GetHogClan(gear) ~= GetHogClan(CurrentHedgehog)) then
       
  1421 			fierceComp = true
       
  1422 			AddCaption(loc("Fierce Competition!") .. " +8 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
       
  1423 			AwardPoints(8)
       
  1424 		end
       
  1425 	end
  1197 end
  1426 end
  1198 
  1427 
  1199 function onGearResurrect(gear)
  1428 function onGearResurrect(gear)
  1200 
  1429 
  1201 	-- did I fall into the water? well, that was a stupid thing to do
  1430 	-- did I fall into the water? well, that was a stupid thing to do
  1202 	if gear == CurrentHedgehog then
  1431 	if gear == CurrentHedgehog then
  1203 		TimeLeft = 0
  1432 		TimeLeft = 0
  1204 		--WriteLnToConsole("Current hedgehog just drowned himself")
  1433 		--WriteLnToConsole("Current hedgehog just drowned himself")
  1205 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1434 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1206 
       
  1207 	end
  1435 	end
  1208 
  1436 
  1209 end
  1437 end
  1210 
  1438 
  1211 function onGearAdd(gear)
  1439 function onGearAdd(gear)
  1231 
  1459 
  1232 end
  1460 end
  1233 
  1461 
  1234 function onGearDelete(gear)
  1462 function onGearDelete(gear)
  1235 
  1463 
  1236 	if GetGearType(gear) == gtShell then
  1464 
       
  1465 	--[[if GetGearType(gear) == gtShell then
  1237 		--nw WriteLnToConsole("on GearDelete call. Shell ID: " .. getGearValue(gear,"ID"))
  1466 		--nw WriteLnToConsole("on GearDelete call. Shell ID: " .. getGearValue(gear,"ID"))
  1238 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1467 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1239 
  1468 
  1240 		--if CurrentHedgehog ~= nil then
  1469 		--if CurrentHedgehog ~= nil then
  1241 		--	WriteLnToConsole("As it happens, player is at: " .. GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog))
  1470 		--	WriteLnToConsole("As it happens, player is at: " .. GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog))
  1247 		--if CurrentHedgehog ~= nil then
  1476 		--if CurrentHedgehog ~= nil then
  1248 		--	WriteLnToConsole("As it happens, player is at: " .. GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog))
  1477 		--	WriteLnToConsole("As it happens, player is at: " .. GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog))
  1249 		--end
  1478 		--end
  1250 	elseif GetGearType(gear) == gtFlame then
  1479 	elseif GetGearType(gear) == gtFlame then
  1251 		--WriteLnToConsole("on GearDelete flame")
  1480 		--WriteLnToConsole("on GearDelete flame")
  1252 	end
  1481 	end]]
  1253 
       
  1254 
       
  1255 
       
  1256 
       
  1257 
  1482 
  1258 	if isATrackedGear(gear) then
  1483 	if isATrackedGear(gear) then
  1259 		trackDeletion(gear)
  1484 		trackDeletion(gear)
  1260 	end
  1485 	end
  1261 
  1486 
  1279 ------------------------------------------------------------
  1504 ------------------------------------------------------------
  1280 ------------------------------------------------------------
  1505 ------------------------------------------------------------
  1281 
  1506 
  1282 function DoHorribleThings(cUID)
  1507 function DoHorribleThings(cUID)
  1283 
  1508 
  1284 	-- maybe
       
  1285 	-- add a check to draw it inside the circ and not past it if
       
  1286 	-- it is closer than 150 or w/e
       
  1287 
       
  1288 	-- work out the distance to the target
  1509 	-- work out the distance to the target
  1289 	g1X, g1Y = GetGearPosition(CurrentHedgehog)
  1510 	g1X, g1Y = GetGearPosition(CurrentHedgehog)
  1290 	g2X, g2Y = vCircX[cUID], vCircY[cUID]
  1511 	g2X, g2Y = vCircX[cUID], vCircY[cUID]
  1291 	q = g1X - g2X
  1512 	q = g1X - g2X
  1292 	w = g1Y - g2Y
  1513 	w = g1Y - g2Y
  1293 	r = math.sqrt( (q*q) + (w*w) )	--alternate
  1514 	r = math.sqrt( (q*q) + (w*w) )	--alternate
  1294 
  1515 
  1295 
       
  1296 	opp = w
  1516 	opp = w
  1297 	if opp < 0 then
  1517 	if opp < 0 then
  1298 		opp = opp*-1
  1518 		opp = opp*-1
  1299 	end
  1519 	end
  1300 
  1520 
  1305 	NR = 150 -- radius at which to draw circs
  1525 	NR = 150 -- radius at which to draw circs
  1306 	NX = math.cos( math.rad(t) ) * NR
  1526 	NX = math.cos( math.rad(t) ) * NR
  1307 	NY = math.sin( math.rad(t) ) * NR
  1527 	NY = math.sin( math.rad(t) ) * NR
  1308 
  1528 
  1309 	-- displace xy based on where this thing actually is
  1529 	-- displace xy based on where this thing actually is
  1310 	if q > 0 then
  1530 
       
  1531 	if r < NR then
       
  1532 		rCircX[cUID] = g2X
       
  1533 	elseif q > 0 then
  1311 		rCircX[cUID] = g1X - NX
  1534 		rCircX[cUID] = g1X - NX
  1312 	else
  1535 	else
  1313 		rCircX[cUID] = g1X + NX
  1536 		rCircX[cUID] = g1X + NX
  1314 	end
  1537 	end
  1315 
  1538 
  1316 	if w > 0 then
  1539 	if r < NR then
       
  1540 		rCircY[cUID] = g2Y
       
  1541 	elseif w > 0 then
  1317 		rCircY[cUID] = g1Y - NY
  1542 		rCircY[cUID] = g1Y - NY
  1318 	else
  1543 	else
  1319 		rCircY[cUID] = g1Y + NY
  1544 		rCircY[cUID] = g1Y + NY
  1320 	end
  1545 	end
  1321 
  1546 
  1322 end
  1547 end
  1323 
  1548 
  1324 function PlayerIsFine()
  1549 function PlayerIsFine()
  1325 	return (playerIsFine)
  1550 	return (playerIsFine)
       
  1551 end
       
  1552 
       
  1553 function GetDistFromXYtoXY(a, b, c, d)
       
  1554 	q = a - c
       
  1555 	w = b - d
       
  1556 	return ( (q*q) + (w*w) )
  1326 end
  1557 end
  1327 
  1558 
  1328 function GetDistFromGearToGear(gear, gear2)
  1559 function GetDistFromGearToGear(gear, gear2)
  1329 
  1560 
  1330 	g1X, g1Y = GetGearPosition(gear)
  1561 	g1X, g1Y = GetGearPosition(gear)
  1420 
  1651 
  1421 	pShield = AddVisualGear(0,0,vgtCircle,0,true)
  1652 	pShield = AddVisualGear(0,0,vgtCircle,0,true)
  1422 	--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 80, 200, 1, 10, 0, 200, 5, 0xff00ffff)
  1653 	--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 80, 200, 1, 10, 0, 200, 5, 0xff00ffff)
  1423 
  1654 
  1424 
  1655 
       
  1656 	shockwave = AddVisualGear(0,0,vgtCircle,0,true)
       
  1657 
  1425 end
  1658 end
  1426 
  1659 
  1427 function IGotMeASafeXYValue(i)
  1660 function IGotMeASafeXYValue(i)
  1428 
  1661 
  1429 	acceptibleDistance = 800
  1662 	acceptibleDistance = 800
  1471 
  1704 
  1472 		elseif (vType[i] == "ammo") then
  1705 		elseif (vType[i] == "ammo") then
  1473 			AddVisualGear(vCircX[i], vCircY[i], vgtExplosion, 0, false)
  1706 			AddVisualGear(vCircX[i], vCircY[i], vgtExplosion, 0, false)
  1474 			PlaySound(sndExplosion)
  1707 			PlaySound(sndExplosion)
  1475 			PlaySound(sndShotgunReload)
  1708 			PlaySound(sndShotgunReload)
  1476 			primShotsLeft = primShotsLeft + 3
  1709 			wepAmmo[0] = wepAmmo[0] +3
       
  1710 			--primShotsLeft = primShotsLeft + 3
  1477 			AddCaption("+" .. 3 .. " " .. loc("Ammo"), 0x00ff00ff,capgrpMessage)
  1711 			AddCaption("+" .. 3 .. " " .. loc("Ammo"), 0x00ff00ff,capgrpMessage)
  1478 			DrawTag(1)
  1712 			DrawTag(1)
  1479 
  1713 
  1480 			GK = GK + 1
  1714 			GK = GK + 1
  1481 			if GK == 3 then
  1715 			if GK == 3 then
  1700 		--nw WriteLnToConsole("Start of CheckVarious(): Exp ID: " .. getGearValue(gear,"ID"))
  1934 		--nw WriteLnToConsole("Start of CheckVarious(): Exp ID: " .. getGearValue(gear,"ID"))
  1701 	--elseif (GetGearType(gear) == gtShell) then
  1935 	--elseif (GetGearType(gear) == gtShell) then
  1702 		--nw WriteLnToConsole("Start of CheckVarious(): Shell ID: " .. getGearValue(gear,"ID"))
  1936 		--nw WriteLnToConsole("Start of CheckVarious(): Shell ID: " .. getGearValue(gear,"ID"))
  1703 	--end
  1937 	--end
  1704 
  1938 
  1705 
       
  1706 
       
  1707 
       
  1708 	targetHit = false
  1939 	targetHit = false
  1709 
  1940 
  1710 	-- if circle is hit by player fire
  1941 	-- if circle is hit by player fire
  1711 	if (GetGearType(gear) == gtExplosives) then
  1942 	if (GetGearType(gear) == gtExplosives) then
  1712 		circsHit = 0
  1943 		circsHit = 0
  1728 					NR = (48/100*vCircRadius[i])/2
  1959 					NR = (48/100*vCircRadius[i])/2
  1729 				end
  1960 				end
  1730 
  1961 
  1731 				if dist <= NR*NR then
  1962 				if dist <= NR*NR then
  1732 
  1963 
  1733 						--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
  1964 
  1734 
  1965 					--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
  1735 					--SetGearPosition(gear, vCircX[i], vCircY[i])
  1966 
  1736 						--WriteLnToConsole("set the gtExplosives to be in the center of circ")
  1967 					dist = (GetDistFromXYtoXY(vCircX[i], vCircY[i], getGearValue(gear,"XP"), getGearValue(gear,"YP")) - (NR*NR))
       
  1968 					--AddCaption(loc("Dist: ") .. dist .. "!",0xffba00ff,capgrpGameState)
       
  1969 					if dist >= 1000000 then
       
  1970 						sniperHits = sniperHits +1
       
  1971 						AddCaption(loc("Sniper!") .. " +8 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
       
  1972 						AwardPoints(8)
       
  1973 						if sniperHits == 3 then
       
  1974 							sniperHits = 0
       
  1975 							AddCaption(loc("They Call Me Bullseye!") .. " +16 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
       
  1976 							AwardPoints(15)
       
  1977 						end
       
  1978 					elseif dist <= 6000 then
       
  1979 						pointBlankHits = pointBlankHits +1
       
  1980 						if pointBlankHits == 3 then
       
  1981 							pointBlankHits = 0
       
  1982 							AddCaption(loc("Point Blank Combo!") .. " +5 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
       
  1983 							AwardPoints(5)
       
  1984 						end
       
  1985 					end
       
  1986 
  1737 					AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
  1987 					AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
  1738 
  1988 
  1739 					targetHit = true
  1989 					targetHit = true
  1740 					--DeleteGear(gear)
  1990 					--DeleteGear(gear)
  1741 					--SetHealth(gear,0)
  1991 					--SetHealth(gear,0)
  1751 						circsHit = 0
  2001 						circsHit = 0
  1752 					end
  2002 					end
  1753 
  2003 
  1754 					shotsHit = shotsHit + 1
  2004 					shotsHit = shotsHit + 1
  1755 
  2005 
       
  2006 
       
  2007 
  1756 				end
  2008 				end
  1757 
  2009 
  1758 			--end
  2010 			--end
  1759 
  2011 
  1760 		end
  2012 		end
  1761 
  2013 
  1762 	-- if player is hit by circle bazooka
  2014 	-- if player is hit by circle bazooka
  1763 	elseif (GetGearType(gear) == gtShell) or (GetGearType(gear) == gtBall) then
  2015 	elseif (GetGearType(gear) == gtShell) then --or (GetGearType(gear) == gtBall) then
  1764 
  2016 
  1765 		dist = GetDistFromGearToGear(gear, CurrentHedgehog)
  2017 		dist = GetDistFromGearToGear(gear, CurrentHedgehog)
  1766 
  2018 
  1767 		if beam == true then
  2019 		if beam == true then
  1768 
  2020 
  1846 
  2098 
  1847 				ss = CircleDamaged(i)
  2099 				ss = CircleDamaged(i)
  1848 				WellHeAintGonnaJumpNoMore(GetX(CurrentHedgehog),GetY(CurrentHedgehog))
  2100 				WellHeAintGonnaJumpNoMore(GetX(CurrentHedgehog),GetY(CurrentHedgehog))
  1849 
  2101 
  1850 				if ss == "fatal" then
  2102 				if ss == "fatal" then
  1851 					if (primShotsLeft == 0) and (TimeLeft <= 9) then
  2103 
       
  2104 					if (wepAmmo[0] == 0) and (TimeLeft <= 9) then
       
  2105 					--if (primShotsLeft == 0) and (TimeLeft <= 9) then
  1852 						AddCaption(loc("Kamikaze Expert!") .. " +15 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
  2106 						AddCaption(loc("Kamikaze Expert!") .. " +15 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
  1853 						AwardPoints(15)
  2107 						AwardPoints(15)
  1854 					elseif (primShotsLeft == 0) then
  2108 					elseif (wepAmmo[0] == 0) then
  1855 						AddCaption(loc("Depleted Kamikaze!") .. " +5 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
  2109 						AddCaption(loc("Depleted Kamikaze!") .. " +5 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
  1856 						AwardPoints(5)
  2110 						AwardPoints(5)
  1857 					elseif TimeLeft <= 9 then
  2111 					elseif TimeLeft <= 9 then
  1858 						AddCaption(loc("Timed Kamikaze!") .. " +10 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
  2112 						AddCaption(loc("Timed Kamikaze!") .. " +10 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
  1859 						AwardPoints(10)
  2113 						AwardPoints(10)
  1904 	for i = 0,(vCCount-1) do
  2158 	for i = 0,(vCCount-1) do
  1905 
  2159 
  1906 		--if (vCircActive[i] == true) then
  2160 		--if (vCircActive[i] == true) then
  1907 			SetVisualGearValues(rCirc[i], rCircX[i], rCircY[i], 100, 255, 1, 10, 0, 40, 3, vCircCol[i]-rAlpha)
  2161 			SetVisualGearValues(rCirc[i], rCircX[i], rCircY[i], 100, 255, 1, 10, 0, 40, 3, vCircCol[i]-rAlpha)
  1908 		--end
  2162 		--end
       
  2163 
       
  2164 
  1909 
  2165 
  1910 		vCounter[i] = vCounter[i] + 1
  2166 		vCounter[i] = vCounter[i] + 1
  1911 		if vCounter[i] >= vCounterLim[i] then
  2167 		if vCounter[i] >= vCounterLim[i] then
  1912 
  2168 
  1913 			vCounter[i] = 0
  2169 			vCounter[i] = 0
  2079 			--	end
  2335 			--	end
  2080 			--end
  2336 			--end
  2081 
  2337 
  2082 		end
  2338 		end
  2083 
  2339 
       
  2340 
       
  2341 		-- derp
       
  2342 		if shockwaveHealth > 0 then
       
  2343 			shockwaveHealth = shockwaveHealth - 1
       
  2344 			shockwaveRad = shockwaveRad + 80
       
  2345 
       
  2346 			--mrm = ((48/100*shockwaveRad)/2)
       
  2347 			--AddVisualGear(GetX(CurrentHedgehog)-mrm+GetRandom(mrm*2),GetY(CurrentHedgehog)-mrm+GetRandom(mrm*2), vgtSmoke, 0, false)
       
  2348 		end
       
  2349 
       
  2350 
       
  2351 
  2084 	end
  2352 	end
  2085 
  2353 
  2086 	for i = 0,(vCCount-1) do
  2354 	for i = 0,(vCCount-1) do
  2087 		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(vCirc[i])		-- vCircCol[i] g10
  2355 		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(vCirc[i])		-- vCircCol[i] g10
  2088 		SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], g3, g4, g5, g6, g7, vCircRadius[i], g9, g10)
  2356 		SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], g3, g4, g5, g6, g7, vCircRadius[i], g9, g10)
  2095 			SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], g3, g4, g5, g6, g7, vCircRadius[i], g9, (vCircCol[i]-FadeAlpha))
  2363 			SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], g3, g4, g5, g6, g7, vCircRadius[i], g9, (vCircCol[i]-FadeAlpha))
  2096 		end
  2364 		end
  2097 	end
  2365 	end
  2098 
  2366 
  2099 
  2367 
  2100 	if (CurrentHedgehog ~= nil) and (beam == true) then
  2368 	if (CurrentHedgehog ~= nil) then
  2101 		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(pShield)
  2369 		if beam == true then
  2102 		--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, g10 )
  2370 			g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(pShield)
  2103 		SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, 0xa800ffff-0x000000ff - -shieldHealth )
  2371 			--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, g10 )
  2104 		DrawTag(2)
  2372 			SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, 0xa800ffff-0x000000ff - -shieldHealth )
  2105 	else
  2373 			DrawTag(2)
  2106 		SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 0, g9, g10 )
  2374 		else
  2107 	end
  2375 			SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 0, g9, g10 )
       
  2376 		end
       
  2377 
       
  2378 		if shockwaveHealth > 0 then
       
  2379 			g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(shockwave)
       
  2380 			SetVisualGearValues(shockwave, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, shockwaveRad, g9, 0xff3300ff-0x000000ff - -shockwaveHealth )
       
  2381 		else
       
  2382 			SetVisualGearValues(shockwave, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 0, g9, g10 )
       
  2383 		end
       
  2384 
       
  2385 	end
       
  2386 
  2108 
  2387 
  2109 end
  2388 end
  2110 
  2389 
  2111 function ProjectileTrack(gear)
  2390 function ProjectileTrack(gear)
  2112 
  2391