Advertisement
Guest User

Hedgewars Script | Girders.lua

a guest
Jan 1st, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. -------------------------------------------
  2. -- Girders (v1.01)
  3. -- Randomly placed girders? Golly!
  4. -- I suck at lua, So girder stats is very very buggy
  5. -------------------------------------------
  6.  
  7. -- General Library Loading
  8. HedgewarsScriptLoad("/Scripts/Locale.lua")
  9. HedgewarsScriptLoad("/Scripts/Tracker.lua")
  10.  
  11. -- Game flag setup
  12. function onGameInit()
  13.     EnableGameFlags(gfDivideTeams, gfSharedAmmo)
  14.     girdersacitvie = TotalRounds + 1
  15.  
  16.  
  17. -- Game scheme setup
  18. MinesNum = 0
  19. MinesTime = 3000
  20. MinesDudPercent = 30
  21. Explosives = 0
  22.  
  23. HealthCaseProb = 0
  24. CrateFreq = 0
  25.  
  26. SuddenDeathTurns = 50
  27. WaterRise = 47
  28. HealthDecrease = 0
  29.  
  30. end
  31.  
  32. -- Display Missiom/Script
  33. function onGameStart()
  34.     ShowMission(loc("Girders"), loc("Golly!"), loc("Randomly spawning girders! Golly!"), -amGirder, 0)
  35. end
  36.  
  37. -- Random girder placement system + Girder Stats system
  38. -- girdersacitvie = Mispelt variable that tracks randomly placed (not hog placed) girders
  39. -- coord1, coord2 = Variable with random coordinates
  40. -- girdertype = Variable that sets a random girder orientation
  41. function onNewTurn()
  42.    girdersacitvie = TotalRounds + 1
  43.    coord1 = GetRandom(2048)
  44.    coord2 = GetRandom(1024)
  45.    girdertype = GetRandom(7)
  46.    PlaceGirder(coord1, coord2, girdertype)
  47.    PlaySound(sndPlaced)
  48.    ShowMission(loc("Girders"), loc("Girder Stats"), loc("Number of Girders " .. girdersacitvie .. "."),  -amGirder, 0)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement