share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
changeset 12988 a15413d896c3
parent 12940 39b7b3ed619e
child 13019 880662cf41ee
equal deleted inserted replaced
12987:ba99ecc53cf0 12988:a15413d896c3
    95 -- Total killed hedgehogs
    95 -- Total killed hedgehogs
    96 local totalKills = 0
    96 local totalKills = 0
    97 
    97 
    98 -- Total damage
    98 -- Total damage
    99 local totalDamage = 0
    99 local totalDamage = 0
       
   100 
       
   101 local mutantHat = "WhySoSerious"
       
   102 local feederHat = "poke_slowpoke"
   100 
   103 
   101 function rules()
   104 function rules()
   102 
   105 
   103 	local ruleSet = loc("Rules: ") .. "|" ..
   106 	local ruleSet = loc("Rules: ") .. "|" ..
   104 	loc("Hedgehogs will be revived after their death.") .. "|" ..
   107 	loc("Hedgehogs will be revived after their death.") .. "|" ..
   328             end
   331             end
   329     end
   332     end
   330 
   333 
   331 end
   334 end
   332 
   335 
       
   336 --[[
       
   337 Forces the special mutant/feeder names and hats only to be
       
   338 taken by those who deserved it.
       
   339 Names and hats will be changed (and ridiculed) if neccesary.
       
   340 ]]
       
   341 function exposeIdentityTheft(gear)
       
   342     local lon = string.lower(GetHogName(gear)) -- lowercase origina name
       
   343     local name, hat
       
   344     -- Change name if hog uses a reserved one
       
   345     if lon == "mutant" or lon == string.lower(loc("Mutant")) then
       
   346        SetHogName(gear, loc("Identity Thief"))
       
   347        SetHogHat(gear, "Disguise")
       
   348     elseif lon == "bottom feeder" or lon == string.lower(loc("Bottom Feeder")) then
       
   349        -- Word play on "Bottom Feeder". Someone who is low on cotton. :D
       
   350        -- Either translate literally or make up your ow word play
       
   351        SetHogName(gear, loc("Cotton Needer"))
       
   352        SetHogHat(gear, "StrawHat")
       
   353     end
       
   354     -- Strip hog off its special hat
       
   355     if GetHogHat(gear) == mutantHat or GetHogHat(gear) == feederHat then
       
   356        SetHogHat(gear, "NoHat")
       
   357     end
       
   358 end
       
   359 
   333 function saveStuff(gear)
   360 function saveStuff(gear)
       
   361     exposeIdentityTheft(gear)
   334     setGearValue(gear,"Name",GetHogName(gear))
   362     setGearValue(gear,"Name",GetHogName(gear))
   335     setGearValue(gear,"Hat",GetHogHat(gear))
   363     setGearValue(gear,"Hat",GetHogHat(gear))
   336 end
   364 end
   337 
   365 
   338 function armageddon(gear)
   366 function armageddon(gear)
   520 end
   548 end
   521 
   549 
   522 function setFeeder(gear)
   550 function setFeeder(gear)
   523     if gear~= mutant and gear~= nil then
   551     if gear~= mutant and gear~= nil then
   524         SetHogName(gear, loc("Bottom Feeder"))
   552         SetHogName(gear, loc("Bottom Feeder"))
   525         SetHogHat(gear, 'poke_slowpoke')
   553         SetHogHat(gear, feederHat)
   526         setGearValue(gear,"Feeder", true)
   554         setGearValue(gear,"Feeder", true)
   527     end
   555     end
   528 end
   556 end
   529 
   557 
   530 function setMutantStuff(gear)
   558 function setMutantStuff(gear)
   531     mutant = gear
   559     mutant = gear
   532 
   560 
   533     SetHogName(gear, loc("Mutant"))
   561     SetHogName(gear, loc("Mutant"))
   534     SetHogHat(gear,'WhySoSerious')
   562     SetHogHat(gear, mutantHat)
   535     SetHealth(gear, ( mutant_base_health + numhhs*25) )
   563     SetHealth(gear, ( mutant_base_health + numhhs*25) )
   536     SetEffect(gear, hePoisoned, 1)
   564     SetEffect(gear, hePoisoned, 1)
   537     setGearValue(mutant,"SelfDestruct",false)
   565     setGearValue(mutant,"SelfDestruct",false)
   538     setGearValue(gear, "Feeder", false)
   566     setGearValue(gear, "Feeder", false)
   539 
   567