rugby changes

This commit is contained in:
Ben Russell (300178622) 2015-02-12 20:16:38 +13:00
parent 23773643f6
commit 62ece7f9af
5 changed files with 145 additions and 17 deletions

View File

@ -348,7 +348,7 @@ mdl_marker = model_load({pmf={bdir=DIR_PKG_PMF, name="marker.pmf"}},{"pmf"})
mdl_tracer = model_load({pmf={bdir=DIR_PKG_PMF, name="tracer.pmf"}},{"pmf"})
mdl_spade = model_load({
kv6={bdir=DIR_PKG_KV6, name="spade.kv6", scale=1.0/16.0},
kv6={bdir=DIR_PKG_KV6, name="spade.kv6", scale=1.0/24.0},
pmf={bdir=DIR_PKG_PMF, name="spade.pmf"},
{},
},{"kv6","pmf"})

View File

@ -272,7 +272,7 @@ function model_loaders.lua(isfile, pkt, extra)
if isfile then pkt = loadfile(pkt) end
if not pkt then return nil end
print(pkt)
--print(pkt)
return pkt
end

View File

@ -769,14 +769,6 @@ function new_player(settings)
mvy = mvy / mvd
mvz = mvz / mvd
-- apply tool speedup
-- TODO: i REALLY, *REALLY* want to move this one out of here. --GM
local msmul = this.tools[this.tool+1].mspeed_mul
if this.mode == PLM_NORMAL and msmul then
mvx = mvx * msmul
mvz = mvz * msmul
end
-- apply base slowdown
local mvspd = MODE_PSPEED_NORMAL
local mvchange = MODE_PSPEED_CHANGE

View File

@ -59,6 +59,26 @@ local function wrap_intel(this)
return "ball"
end
local s_render_backpack = this.render_backpack
function this.render_backpack(...)
if this.player.tool ~= 2 then
return s_render_backpack(...)
end
end
function this.spawn()
local xlen,ylen,zlen
xlen,ylen,zlen = common.map_get_dims()
this.x = xlen/2
this.z = zlen/2
this.y = (common.map_pillar_get(this.x, this.z))[1+1]
return this.spawn_at(this.x, this.y, this.z)
end
return this
end
@ -67,10 +87,81 @@ function new_intel(settings, ...)
return wrap_intel(this)
end
function new_ballslot(plr)
local this = {} this.this = this
this.plr = plr
this.gui_x = 0.15
this.gui_y = 0.35
this.gui_scale = 0.3
this.gui_pick_scale = 1.0
function this.get_model()
-- WARNING: model index is hardcoded!
return (plr.has_intel and plr.has_intel.mdl_intel) or miscents[3].mdl_intel
end
function this.render(px,py,pz,ya,xa,ya2)
if plr.has_intel then
local mdl = this.get_model()
mdl.render_global(
px, py, pz, ya, xa, ya2, 1)
end
end
function this.click(button, state)
if plr.has_intel == this and state then
if button == 1 then
-- LMB: throw
elseif button == 3 then
-- RMB: punt
end
end
end
function this.restock()
end
function this.tick(sec_current, sec_delta)
end
function this.key(key, state, modif)
end
function this.free()
end
function this.focus()
end
function this.unfocus()
end
function this.textgen()
return 0xFFFFFFFF, ""
end
return this
end
local s_new_player = new_player
function new_player(...)
local this = s_new_player(...)
local s_add_tools_list = this.add_tools_list
function this.add_tools_list(...)
if this.mode ~= PLM_NORMAL then return s_add_tools_list(...) end
this.tools[#(this.tools)+1] = tools[TOOL_SPADE](this)
this.tools[#(this.tools)+1] = tools[TOOL_BLOCK](this)
this.tools[#(this.tools)+1] = new_ballslot(this)
this.tool = 2
this.tool_last = 0
end
local s_show_hud = this.show_hud
function this.show_hud(sec_current, sec_delta, ...)
-- this is a bit derpy so dummied out for now
@ -105,18 +196,58 @@ function new_player(...)
return s_show_hud(sec_current, sec_delta, ...)
end
local s_wpn_damage = this.wpn_damage
function this.wpn_damage(part, amt, enemy, dmsg, ...)
--print("damage",this.name,part,amt)
if server then
if (not this.has_intel) and (not enemy.has_intel) then
return
end
if dmsg == "spaded" then
dmsg = "tackled"
end
end
return s_wpn_damage(part, amt, enemy, dmsg, ...)
end
return this
end
if miscents then
local i
for i=1,#miscents do
if miscents[i].type == "intel" then
miscents[i] = wrap_intel(miscents[i])
end
local s_new_tent = new_tent
function new_tent(...)
local this = s_new_tent(...)
function this.spawn()
local xlen,ylen,zlen
xlen,ylen,zlen = common.map_get_dims()
this.x = 19.5
this.z = zlen/2
if this.team == 1 then this.x = xlen - this.x end
this.y = (common.map_pillar_get(this.x, this.z))[1+1]
return this.spawn_at(this.x, this.y, this.z)
end
return this
end
local s_mode_reset = mode_reset
function mode_reset(...)
return s_mode_reset(...)
end
if server then
mode_create_server()
mode_reset()
else
mode_create_client()
end
--[[
local i
for i=1,#weapons do
local s_weapon = weapons[i]
@ -126,6 +257,10 @@ for i=1,#weapons do
local s_tick = this.tick
function this.tick(sec_current, sec_delta, ...)
if not plr.has_intel then return s_tick(sec_current, sec_delta, ...) end
this.firing = false
this.reloading = false
plr.zooming = false
this.arm_rest_left = 0
end
local s_get_model = this.get_model
@ -149,6 +284,7 @@ for i=1,#weapons do
return this
end
end
]]
end

View File

@ -58,7 +58,7 @@ do
end
function this.render_local(x, y, z, r1, r2, r3, s)
client.va_render_local(this.va, x, y, z, r1, r2, r3, s, this.tex)
client.va_render_local(this.va, -x, y, z, r1, r2, r3, s, this.tex)
end
return this