Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HedgewarsScriptLoad("/Scripts/Locale.lua")
- HedgewarsScriptLoad("/Scripts/Tracker.lua")
- HedgewarsScriptLoad("/Scripts/Utils.lua")
- -- store number of hedgehogs
- local numhhs = 0
- function onGameInit() --make it so it is like a normal shoppa game
- GameFlags = gfSolidLand +gfBorder +gfResetWeps +gfRandomOrder +gfInvulnerable +gfInfAttack
- TurnTime = 999999
- CaseFreq = 0
- MinesNum = 8
- Explosives = 0
- Delay = 500
- SuddenDeathTurns = 99999 -- "disable" sudden death
- Map = '0ashoppaspeedzonetest'
- Theme = "Eyes"
- end
- function onGameStart()
- vgtCircle1 = AddVisualGear(Z1x, Z1y, vgtCircle, 0, true) -- TheAnachron thanks and to UltiMaxKom ! -- so i need to name that variable so the next line (setvisualgearvalues know where to applied its effect !)
- SetVisualGearValues(vgtCircle1, Z1x, Z1y, 0, 255, 1, 5, 0, 600, 25, 0xff0000ff)
- vgtCircle2 = AddVisualGear(Z2x, Z2y, vgtCircle, 0, true)
- SetVisualGearValues(vgtCircle2, Z2x, Z2y, 0, 255, 1, 5, 0, 600, 25, 0xff0000ff)
- vgtCircle3 = AddVisualGear(Z3x, Z3y, vgtCircle, 0, true)
- SetVisualGearValues(vgtCircle3, Z3x, Z3y, 0, 255, 1, 5, 0, 600, 25, 0xff0000ff)
- vgtCircle4 = AddVisualGear(Z4x, Z4y, vgtCircle, 0, true)
- SetVisualGearValues(vgtCircle4, Z14, Z4y, 0, 255, 1, 5, 0, 600, 25, 0xff0000ff)
- --1530,814
- --on peut faire une array genre : zone1x = 1530 et zone1y = 814 , plus facile pour remplacer d'autres truc non ? oui !
- Z1x = 4096
- Z1y = 2807
- Z2x = 6282
- Z2y = 3052
- Z3x = 3648
- Z3y = 2743
- Z4x = 2717
- Z4y = 1927
- -- put: 4906, 2807 put: 6282, 3052 put: 3648, 2743 put: 2717, 1927
- end
- function onAmmoStoreInit()
- SetAmmo(amRope, 9, 1, 0)
- SetAmmo(amSkip, 9, 1, 0)
- SetAmmo(amTeleport, 9, 1, 0)
- end
- function onGameTick20()
- --create teleporter for big maps too !
- --8k/4k maps are too big (=4normal maps) so lets try a map more like 6k3k ? or even 4k8k or even 2k8k (=en hauteur, avec des étages)
- --test sur shoppastyle2 aussi, la map est assez grande ! pourrait bénéficier des accelzones
- if CurrentHedgehog ~= nil then
- dx, dy = GetGearVelocity(CurrentHedgehog) -- j'imagine que getGearVelocity donne deux nombre, qu'on appellera ici dx et dy, on peut en fait les nommer comme on veut. (genre px et py mais il faut changer l'appelation dans setGearVelocity)
- if (gearIsInCircle(CurrentHedgehog, Z1x, Z1y, 350, useRadius)) then --gearIsInCircle(gear, x, y, r, useRadius)
- SetGearVelocity(CurrentHedgehog, dx*1.5, dy*1.5)
- AddVisualGear(hpx, hpy, vgtEvilTrace, 0, true)
- end
- if (gearIsInCircle(CurrentHedgehog, Z2x, Z2y, 350, useRadius)) then
- SetGearVelocity(CurrentHedgehog, dx*1.5, dy*1.5)
- AddVisualGear(hpx, hpy, vgtEvilTrace, 0, true)
- end
- if (gearIsInCircle(CurrentHedgehog, Z3x, Z3y, 350, useRadius)) then
- SetGearVelocity(CurrentHedgehog, dx*1.5, dy*1.5)
- AddVisualGear(hpx, hpy, vgtEvilTrace, 0, true)
- end
- if (gearIsInCircle(CurrentHedgehog, Z4x, Z4y, 350, useRadius)) then
- SetGearVelocity(CurrentHedgehog, dx*1.5, dy*1.5)
- AddVisualGear(hpx, hpy, vgtEvilTrace, 0, true)
- end
- --below 5 lines are for ropes map...
- -- if (gearIsInBox(CurrentHedgehog, 4010, 1548, 82, 237)) and dy<=0 then --gearIsInCircle(gear, x, y, r, useRadius) -- dy<=0 works
- -- SetGearVelocity(CurrentHedgehog, dx, dy*2)--find a way so it is only to the top, currently it take the inithial direction and multiply it, i should do sth like >0 or <0
- --like : if dx <0 then return, if dx >0 then dx*2 ?
- -- elseif (gearIsInBox(CurrentHedgehog, 4010, 1548, 82, 237)) and dy>=0 then --if you go down since dy>0 then you go left (just to try ...)
- -- SetGearVelocity(CurrentHedgehog, -50000, dy) -- looks like 50000 is not real fast, might explain my result on speed hpx and hpy below
- -- end -- i think when dy is negative (dy<0 dy=-xxx) you go up.
- hpx, hpy = GetGearPosition(CurrentHedgehog)
- --speed = (dx*1.0000001+dy*1.0000001)/2000 --commentary this so next line we try to put in on square root so it doesnt have any negative results and should work
- speedsquare = (dx*1.0000001+dy*1.0000001)*(dx*1.0000001+dy*1.0000001)
- speedsqrt = speedsquare/(dx*1.0000001+dy*1.0000001)
- speed = speedsqrt/2000
- --speedmax = -- and then we calcul the speed necessary for each vgt like : 1/5 of maxspeed : maxspeed/5)*1 or *2 etc
- -- if speed = 0 and speed <5 then
- -- end
- --num = math.abs(num)
- -- note : this below, doesnt work as expected, but, vgt following hog work, so should work too when they are sped up by a zone, should be good enough, one vgt would be sufficient,
- -- note : the acceleration vgt is not working (from vgt1 to vg10 my calcul of speed is not working....)
- if speed >50 and speed < 20 then
- AddVisualGear(hpx, hpy, vgtDroplet, 0, true)
- elseif speed >20 and speed < 70 then
- AddVisualGear(hpx, hpy, vgtBubble, 0, true)
- elseif speed >70 and speed < 110 then
- AddVisualGear(hpx, hpy, vgtSmokeTrace, 0, true)
- elseif speed >110 and speed < 130 then
- AddVisualGear(hpx, hpy, vgtSmokeWhite, 0, true)
- elseif speed >130 and speed < 160 then
- AddVisualGear(hpx, hpy, vgtDust, 0, true)
- elseif speed >160 and speed < 190 then
- AddVisualGear(hpx, hpy, vgtSmoke, 0, true)
- elseif speed >190 and speed < 215 then
- AddVisualGear(hpx, hpy, vgtEvilTrace, 0, true)
- elseif speed >215 then
- AddVisualGear(hpx, hpy, vgtFire, 0, true)
- --vgtSmoke = AddVisualGear(hpx, hpy, vgtSmoke, 0, true) -- when i let this, i doesnt work, next line work.
- --AddVisualGear(hpx, hpy, vgtSmoke, 0, true) it works but lets try something like : if speed = 1 : bubble, if speed = 10 white smoke, speed = 20 smoke and speed 50 = fire ? even try a hog ghost following him ?
- -- Droplet, Dust, Bubble, Smoke, vgtSmokeWhite, vgtSteam, vgtFire
- -- vgtDroplet, vgtBubble, vgtSmokeTrace,vgtSmokeWhite, vgtDust, vgtSmoke, vgtEvilTrace, vgtFire
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement