diff --git a/src/server/gamerules.qc b/src/server/gamerules.qc index 5542557..bbc95af 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -47,6 +47,11 @@ HLGameRules::DamageApply(entity t, entity c, float dmg, int w, damageType_t type return; } + if (t.health > 100) + t.max_health = 200; + else + t.max_health = 100; + super::DamageApply(t, c, dmg, w, type); } diff --git a/src/server/gamerules_multiplayer.qc b/src/server/gamerules_multiplayer.qc index 649a72f..10cfba6 100644 --- a/src/server/gamerules_multiplayer.qc +++ b/src/server/gamerules_multiplayer.qc @@ -43,6 +43,8 @@ HLMultiplayerRules::IsTeamplay(void) void HLMultiplayerRules::InitPostEnts(void) { + precache_model("models/backpack.mdl"); + MOTD_LoadDefault(); if (IsTeamplay() == true) { @@ -125,6 +127,8 @@ HLMultiplayerRules::PlayerDeath(NSClientPlayer pl) FX_Corpse_Spawn((player)pl, ANIM_DIESIMPLE); } + dmc_backpack_spawn((player)pl); + /* now let's make the real client invisible */ pl.Death(); pl.SetTakedamage(DAMAGE_NO); diff --git a/src/server/item_weaponbox.qc b/src/server/item_weaponbox.qc index 9ca9d37..b6f3882 100644 --- a/src/server/item_weaponbox.qc +++ b/src/server/item_weaponbox.qc @@ -14,12 +14,12 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -class item_weaponbox:NSRenderableEntity +class item_backpack:NSRenderableEntity { - int weapon_items; + int weapon_item; - void(void) item_weaponbox; + void(void) item_backpack; virtual void(void) Spawned; virtual void(entity) Touch; @@ -27,7 +27,7 @@ class item_weaponbox:NSRenderableEntity }; void -item_weaponbox::Touch(entity eToucher) +item_backpack::Touch(entity eToucher) { if (eToucher.classname != "player") { return; @@ -48,45 +48,49 @@ item_weaponbox::Touch(entity eToucher) pl.ammo_rockets = min(pl.ammo_rockets, MAX_A_ROCKETS); pl.ammo_cells = min(pl.ammo_cells, MAX_A_CELLS); - pl.g_items |= weapon_items; + pl.g_items |= g_weapons[weapon_item].id; Weapons_RefreshAmmo(pl); + sprint(pl, PRINT_HIGH, sprintf("You get the %s, %d shells, %d nails, %d rockets, %d cells\n", g_weapons[weapon_item].name, ammo_shells, ammo_nails, ammo_rockets, ammo_cells)); + Destroy(); } void -item_weaponbox::setup(player pl) +item_backpack::setup(player pl) { - /* TODO: Should the magazine bits be transferred too? */ - ammo_shells = pl. ammo_shells; - ammo_nails = pl. ammo_nails; - ammo_rockets = pl.ammo_rockets; - ammo_cells = pl.ammo_cells; - weapon_items = pl.g_items; } void -item_weaponbox::Spawned(void) +item_backpack::Spawned(void) { super::Spawned(); - SetModel("models/w_weaponbox.mdl"); + SetModel("models/backpack.mdl"); SetSize([-16,-16,0], [16,16,16]); SetSolid(SOLID_TRIGGER); SetMovetype(MOVETYPE_TOSS); + modelflags = MF_ROTATE; } void -item_weaponbox::item_weaponbox(void) +item_backpack::item_backpack(void) { botinfo = BOTINFO_AMMO; } void -weaponbox_spawn(player spawner) +dmc_backpack_spawn(player spawner) { - item_weaponbox weaponbox = spawn(item_weaponbox); + item_backpack weaponbox = spawn(item_backpack); + weaponbox.Spawned(); weaponbox.SetOrigin(spawner.origin); - weaponbox.setup(spawner); + + weaponbox.ammo_shells = spawner.ammo_shells; + weaponbox.ammo_nails = spawner.ammo_nails; + weaponbox.ammo_rockets = spawner.ammo_rockets; + weaponbox.ammo_cells = spawner.ammo_cells; + weaponbox.weapon_item = spawner.activeweapon; + //bprint(PRINT_HIGH, sprintf("Dropped the %s, %d shells, %d nails, %d rockets, %d cells.\n", g_weapons[weapon_item].name, ammo_shells, ammo_nails, ammo_rockets, ammo_cells)); } diff --git a/src/shared/w_nailgun.qc b/src/shared/w_nailgun.qc index 1c54531..a2fbaa1 100644 --- a/src/shared/w_nailgun.qc +++ b/src/shared/w_nailgun.qc @@ -121,6 +121,7 @@ w_nailgun_primary(player pl) entity nail = spawn(); setmodel(nail, "models/spike.mdl"); + vector velOffset = pl.velocity * input_timelength; setsize(nail, g_vec_null, g_vec_null); nail.movetype = MOVETYPE_FLYMISSILE; nail.solid = SOLID_BBOX; @@ -129,10 +130,10 @@ w_nailgun_primary(player pl) Weapons_MakeVectors(pl); if (pl.ammo_nails & 1) { - setorigin(nail, Weapons_GetCameraPos(pl) + (v_right * -2) + (v_up * -5)); + setorigin(nail, velOffset + Weapons_GetCameraPos(pl) + (v_right * -2) + (v_up * -5)); nail.velocity = v_forward * 1000 + (v_right * -2) + (v_up * -5); } else { - setorigin(nail, Weapons_GetCameraPos(pl) + (v_right * 2) + (v_up * -5)); + setorigin(nail, velOffset + Weapons_GetCameraPos(pl) + (v_right * 2) + (v_up * -5)); nail.velocity = v_forward * 1000 + (v_right * 2) + (v_up * -5); } nail.angles = vectoangles(nail.velocity); diff --git a/src/shared/w_supernailgun.qc b/src/shared/w_supernailgun.qc index aaaba0e..32ba138 100644 --- a/src/shared/w_supernailgun.qc +++ b/src/shared/w_supernailgun.qc @@ -128,7 +128,8 @@ w_supernailgun_primary(player pl) entity nail = spawn(); setmodel(nail, "models/spike.mdl"); - setorigin(nail, Weapons_GetCameraPos(pl) + (v_up * -5)); + vector velOffset = pl.velocity * input_timelength; + setorigin(nail, velOffset + Weapons_GetCameraPos(pl) + (v_up * -5)); setsize(nail, g_vec_null, g_vec_null); nail.movetype = MOVETYPE_FLYMISSILE; nail.solid = SOLID_BBOX; diff --git a/zpak001.pk3dir/def/q3items.def b/zpak001.pk3dir/def/q3items.def index 6af2483..8ae5a16 100644 --- a/zpak001.pk3dir/def/q3items.def +++ b/zpak001.pk3dir/def/q3items.def @@ -1,13 +1,13 @@ entityDef q3_item_health_large { - spawnclass item_health + "spawnclass" "item_health" } entityDef q3_item_health_mega { - spawnclass item_health - spawnflags 2 + "spawnclass" "item_health" + "spawnflags" "2" } entityDef q3_item_health_small { - spawnclass item_health - spawnflags 1 + "spawnclass" "item_health" + "spawnflags" "1" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/qdmtweaks.def b/zpak001.pk3dir/def/qdmtweaks.def index 0fcda48..2527fa6 100644 --- a/zpak001.pk3dir/def/qdmtweaks.def +++ b/zpak001.pk3dir/def/qdmtweaks.def @@ -1,5 +1,5 @@ // Quake 1's buttons are triggered by touch most of the time entityDef q1_func_button { - spawnclass func_button - spawnflags 256 + "spawnclass" "func_button" + "spawnflags" "256" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/teleporter.def b/zpak001.pk3dir/def/teleporter.def index 1004381..9a22913 100644 --- a/zpak001.pk3dir/def/teleporter.def +++ b/zpak001.pk3dir/def/teleporter.def @@ -1,4 +1,4 @@ entityDef dmc_trigger_teleport { - spawnclass trigger_teleport - snd_teleport "dmc_teleporter.teleported" + "spawnclass" "trigger_teleport" + "snd_teleport" "dmc_teleporter.teleported" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_grenadelauncher.def b/zpak001.pk3dir/def/weapon_grenadelauncher.def index 6488ec7..836010d 100644 --- a/zpak001.pk3dir/def/weapon_grenadelauncher.def +++ b/zpak001.pk3dir/def/weapon_grenadelauncher.def @@ -1,15 +1,15 @@ entityDef weapon_grenadelauncher { - "editor_color" ".3 .3 1" - "editor_mins" "-16 -16 0" - "editor_maxs" "16 16 32" - "editor_usage" "Grenade Launcher" - "editor_rotatable" "1" + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Grenade Launcher" + "editor_rotatable" "1" - "spawnclass" "NSItem" - "model" "models/g_rock.mdl" - "inv_item" "6" - "snd_acquire" "dmc_weapon.pickup" - "snd_respawn" "dmc_item.respawn" - "spin" "1" + "spawnclass" "NSItem" + "model" "models/g_rock.mdl" + "inv_item" "6" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_lightning.def b/zpak001.pk3dir/def/weapon_lightning.def index d46898f..c736495 100644 --- a/zpak001.pk3dir/def/weapon_lightning.def +++ b/zpak001.pk3dir/def/weapon_lightning.def @@ -1,15 +1,15 @@ entityDef weapon_lightning { - "editor_color" ".3 .3 1" - "editor_mins" "-16 -16 0" - "editor_maxs" "16 16 32" - "editor_usage" "Lightning Gun" - "editor_rotatable" "1" + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Lightning Gun" + "editor_rotatable" "1" - "spawnclass" "NSItem" - "model" "models/g_light.mdl" - "inv_item" "8" - "snd_acquire" "dmc_weapon.pickup" - "snd_respawn" "dmc_item.respawn" - "spin" "1" + "spawnclass" "NSItem" + "model" "models/g_light.mdl" + "inv_item" "8" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_nailgun.def b/zpak001.pk3dir/def/weapon_nailgun.def index d2080a8..65794f4 100644 --- a/zpak001.pk3dir/def/weapon_nailgun.def +++ b/zpak001.pk3dir/def/weapon_nailgun.def @@ -1,15 +1,15 @@ entityDef weapon_nailgun { - "editor_color" ".3 .3 1" - "editor_mins" "-16 -16 0" - "editor_maxs" "16 16 32" - "editor_usage" "Nailgun" - "editor_rotatable" "1" + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Nailgun" + "editor_rotatable" "1" - "spawnclass" "NSItem" - "model" "models/g_nail.mdl" - "inv_item" "4" - "snd_acquire" "dmc_weapon.pickup" - "snd_respawn" "dmc_item.respawn" - "spin" "1" + "spawnclass" "NSItem" + "model" "models/g_nail.mdl" + "inv_item" "4" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_rocketlauncher.def b/zpak001.pk3dir/def/weapon_rocketlauncher.def index 0f502b0..2c12c21 100644 --- a/zpak001.pk3dir/def/weapon_rocketlauncher.def +++ b/zpak001.pk3dir/def/weapon_rocketlauncher.def @@ -1,15 +1,15 @@ entityDef weapon_rocketlauncher { - "editor_color" ".3 .3 1" - "editor_mins" "-16 -16 0" - "editor_maxs" "16 16 32" - "editor_usage" "Rocket Launcher" - "editor_rotatable" "1" + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Rocket Launcher" + "editor_rotatable" "1" - "spawnclass" "NSItem" - "model" "models/g_rock2.mdl" - "inv_item" "7" - "snd_acquire" "dmc_weapon.pickup" - "snd_respawn" "dmc_item.respawn" - "spin" "1" + "spawnclass" "NSItem" + "model" "models/g_rock2.mdl" + "inv_item" "7" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_supernailgun.def b/zpak001.pk3dir/def/weapon_supernailgun.def index c489d78..2936538 100644 --- a/zpak001.pk3dir/def/weapon_supernailgun.def +++ b/zpak001.pk3dir/def/weapon_supernailgun.def @@ -1,15 +1,15 @@ entityDef weapon_supernailgun { - "editor_color" ".3 .3 1" - "editor_mins" "-16 -16 0" - "editor_maxs" "16 16 32" - "editor_usage" "Super Nailgun" - "editor_rotatable" "1" + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Super Nailgun" + "editor_rotatable" "1" - "spawnclass" "NSItem" - "model" "models/g_nail2.mdl" - "inv_item" "5" - "snd_acquire" "dmc_weapon.pickup" - "snd_respawn" "dmc_item.respawn" - "spin" "1" + "spawnclass" "NSItem" + "model" "models/g_nail2.mdl" + "inv_item" "5" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" } \ No newline at end of file diff --git a/zpak001.pk3dir/def/weapon_supershotgun.def b/zpak001.pk3dir/def/weapon_supershotgun.def index cfb7075..062c797 100644 --- a/zpak001.pk3dir/def/weapon_supershotgun.def +++ b/zpak001.pk3dir/def/weapon_supershotgun.def @@ -1,15 +1,15 @@ entityDef weapon_supershotgun { - "editor_color" ".3 .3 1" - "editor_mins" "-16 -16 0" - "editor_maxs" "16 16 32" - "editor_usage" "Super Shotgun" - "editor_rotatable" "1" + "editor_color" ".3 .3 1" + "editor_mins" "-16 -16 0" + "editor_maxs" "16 16 32" + "editor_usage" "Super Shotgun" + "editor_rotatable" "1" - "spawnclass" "NSItem" - "model" "models/g_shot2.mdl" - "inv_item" "3" - "snd_acquire" "dmc_weapon.pickup" - "snd_respawn" "dmc_item.respawn" - "spin" "1" + "spawnclass" "NSItem" + "model" "models/g_shot2.mdl" + "inv_item" "3" + "snd_acquire" "dmc_weapon.pickup" + "snd_respawn" "dmc_item.respawn" + "spin" "1" } \ No newline at end of file