Post by BanaaN* on Nov 4, 2010 16:57:30 GMT 2
I noticed that, even though there is a deathmatch gamemode, it is not really possible to also play in deathmatch. So I created the deathmatch compatibility mode.
Note that I haven't tested it with the spy!!!
Features:
Please tell me if I have forgotten anything or if something doesn't work.
The (new) Team Fortress 2D.lua file is included, all changed code can be seen below.
-- Changed:
-- tf2d.heal (only heal players of same team, don't heal others in dm)
-- tf2d.pyropower (burn if gamemode is deathmatch)
-- tf2d.notk (allow tk if gamemode is deathmatch, slow enemy down with MGun if gm is dm)
-- tf2d.crits (crit if gm is dm)
-- tf2d.ach4 (also count damage done in dm)
Note that I haven't tested it with the spy!!!
Features:
- Medic doesn't heal other players in dm, otherwise only heals players of his own team,
- Team kill is no longer prevented,
- MGun also slows down players of own team,
- All people will burn,
- Crits are enabled,
- Damage to own teammates is also counted in the 'xxx damage' achievements.
Please tell me if I have forgotten anything or if something doesn't work.
The (new) Team Fortress 2D.lua file is included, all changed code can be seen below.
-- Changed:
-- tf2d.heal (only heal players of same team, don't heal others in dm)
-- tf2d.pyropower (burn if gamemode is deathmatch)
-- tf2d.notk (allow tk if gamemode is deathmatch, slow enemy down with MGun if gm is dm)
-- tf2d.crits (crit if gm is dm)
-- tf2d.ach4 (also count damage done in dm)
function tf2d.heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 2) then
if(game("sv_gamemode")~="1") then
if(player(id,"team")==player(source,"team")) then
parse ("sethealth "..id.." "..player(id,"health")+18)
return 1
end
end
end
end
function tf2d.pyropower(id,source,weapon,hpdmg,apdmg)
if weapon==46 then
if player(id,"team")==player(source,"team") and spycheck[id]==1 and teem[id]~=player(source,"team") then
onfire[id]=1
tf2d.fired[id]=source
return 0
end
if player(id,"team")~=player(source,"team") then
onfire[id]=1
tf2d.fired[id]=source
return 0
end
if game("sv_gamemode")=="1" then
onfire[id]=1
tf2d.fired[id]=source
return 0
end
end
end
function tf2d.notk(id,s,w)
if tf2d.classes.class[s]==5 and w==40 and (player(id,"team")~=player(s,"team") or game("sv_gamemode")=="1") then
parse("speedmod "..id.." -15")
end
if id==s then
return 0
end
if player(id,"team")==player(s,"team") then
if(game("sv_gamemode")~="1") then
if spycheck[id]==1 then
if teem[id]~=player(s,"team") then
return 0
else
return 1
end
else
return 1
end
end
end
if tf2d.classes.class[s]==9 and player(id,"team")~=player(s,"team") and w==50 and player(id,"rot")>=player(s,"rot")-90 and player(id,"rot")<=player(s,"rot")+90 then
parse("customkill "..s.." BACKSTAB "..id)
return 1
end
if player(id,"team")~=player(s,"team") and spycheck[id]==1 then
if teem[id]==player(s,"team") then
return 1
else
return 0
end
end
end
function tf2d.crits(id,source,weapon,hpdmg,apdmg)
if crits==1 then
if (player(source,"team")~=player(id,"team") or game("sv_gamemode")=="1") and source~=id and teem[id]==player(id,"team") then
if lastcrit[source]==1 then
critted[id]=1
if critimg[id]~=0 then
critimg[id]=image("gfx/mat5b/crit.png",1,0,1)
end
parse('sv_sound2 '..id..' crit_hit.wav')
parse('sv_sound2 '..source..' crit_hit.wav')
if player(id,"health")<=hpdmg*2 then
parse("customkill "..source.." CRIT "..id.."")
else
parse('sethealth '..id..' '..player(id,"health")-hpdmg*2)
end
timer(1000,"tf2d.nocrits",""..id.."",1)
critical_hit(id,source)
return 1
end
crit[source]=math.random(1,30)
if crit[source]==7 then
critted[id]=1
if critimg[id]==0 then
critimg[id]=image("gfx/tf2/crit.png",1,0,1)
end
parse('sv_sound2 '..id..' crit_hit.wav')
parse('sv_sound2 '..source..' crit_hit.wav')
if player(id,"health")-hpdmg*2>=1 then
parse('sethealth '..id..' '..player(id,"health")-hpdmg*2)
else
parse('customkill '..source..' '..itemtype(weapon,"name")..'(Critical) '..id)
end
timer(1000,"tf2d.nocrits",""..id.."",1)
critical_hit(id,source)
return 1
end
end
end
end
function tf2d.ach4(id,source,weapon,hpdmg,apdmg)
if weapon~=0 and not player(source,"bot") and (player(source,"team")~=player(id,"team") or game("sv_gamemode")=="1") then
ac4[source]=ac4[source]+hpdmg
if ac4[source]>=1000 then
if ac8[source]==0 then
msg ("©255255255"..player(source,"name").." unlocked the A Thousand Damage achievement!@C")
parse ("sv_sound happy_birthday.ogg")
ac8[source]=1
numbac[source]=numbac[source]+1
lastac[source]="A Thousand Damage"
st29[source]="Done"
end
end
if ac4[source]>=5000 then
if ac11[source]==0 then
msg ("©255255255"..player(source,"name").." unlocked the Five Thousand Damage achievement!@C")
parse ("sv_sound happy_birthday.ogg")
ac11[source]=1
numbac[source]=numbac[source]+1
lastac[source]="Five Thousand Damage"
st30[source]="Done"
end
end
if ac4[source]>=10000 then
if ac12[source]==0 then
msg ("©255255255"..player(source,"name").." unlocked the A Thousand Damage x 10 achievement!@C")
parse ("sv_sound happy_birthday.ogg")
ac12[source]=1
numbac[source]=numbac[source]+1
lastac[source]="A Thousand Damage x 10"
st31[source]="Done"
end
end
if ac4[source]>=50000 then
if ac13[source]==0 then
msg ("©255255255"..player(source,"name").." unlocked the A Thousand Damage x 50 achievement!@C")
parse ("sv_sound happy_birthday.ogg")
ac13[source]=1
numbac[source]=numbac[source]+1
lastac[source]="A Thousand Damage x 50"
st32[source]="Done"
end
end
if ac4[source]>=100000 then
if ac14[source]==0 then
msg ("©255255255"..player(source,"name").." unlocked the A Thousand Damage x 100 achievement!@C")
parse ("sv_sound happy_birthday.ogg")
ac14[source]=1
numbac[source]=numbac[source]+1
lastac[source]="A Thousand Damage x 100"
st33[source]="Done"
end
end
if ac4[source]>=200000 then
if ac15[source]==0 then
msg ("©255255255"..player(source,"name").." unlocked the A Thousand Damage x 200 achievement!@C")
parse ("sv_sound happy_birthday.ogg")
ac15[source]=1
numbac[source]=numbac[source]+1
lastac[source]="A Thousand Damage x 200"
st34[source]="Done"
end
end
end
end