diff --git a/src/server/gamerules_multiplayer.qc b/src/server/gamerules_multiplayer.qc index f978ac7..86873ef 100644 --- a/src/server/gamerules_multiplayer.qc +++ b/src/server/gamerules_multiplayer.qc @@ -214,10 +214,8 @@ HLMultiplayerRules::PlayerSpawn(NSClientPlayer pp) #endif spot = Spawn_SelectRandom("info_player_deathmatch"); - pl.SetOrigin(spot.origin); - pl.SetAngles(spot.angles); + pl.Transport(spot.origin, spot.angles); Weapons_RefreshAmmo(pl); - Client_FixAngle(pl, pl.angles); } @@ -234,7 +232,7 @@ HLMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd) int r = floor(random(0, search_getsize(pm))); string mdl = substring(search_getfilename(pm, r), 0, -5); tokenizebyseparator(mdl, "/"); - forceinfokey(pete, "model", argv(2)); + pete.SetInfoKey("model", argv(2)); search_end(pm); break; case "jumptest": diff --git a/src/server/gamerules_singleplayer.qc b/src/server/gamerules_singleplayer.qc index d06db21..13c3880 100644 --- a/src/server/gamerules_singleplayer.qc +++ b/src/server/gamerules_singleplayer.qc @@ -23,20 +23,21 @@ HLSingleplayerRules::IsMultiplayer(void) void HLSingleplayerRules::PlayerDeath(NSClientPlayer pl) { - pl.movetype = MOVETYPE_NONE; - pl.solid = SOLID_NOT; - pl.takedamage = DAMAGE_NO; + pl.SetMovetype(MOVETYPE_NONE); + pl.SetSolid(SOLID_NOT); + pl.SetTakedamage(DAMAGE_NO); + pl.SetHealth(0); + pl.StartSoundDef("player.die", CHAN_AUTO, true); + pl.gflags &= ~GF_FLASHLIGHT; pl.armor = pl.activeweapon = pl.g_items = pl.weapon = 0; - pl.health = 0; - Sound_Play(pl, CHAN_AUTO, "player.die"); if (cvar("coop") == 1) { - pl.think = PutClientInServer; - pl.nextthink = time + 4.0f; + pl.ScheduleThink(PutClientInServer, 4.0f); } - if (pl.health < -50) { + /* so much damage we're gonna gib */ + if (pl.GetHealth() < -50) { FX_GibHuman(pl.origin, vectoangles(pl.origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f); } @@ -56,51 +57,43 @@ HLSingleplayerRules::PlayerDeath(NSClientPlayer pl) void HLSingleplayerRules::PlayerSpawn(NSClientPlayer pl) { + string playerModel = "models/player.mdl"; + pl.classname = "player"; - pl.health = pl.max_health = 100; - pl.takedamage = DAMAGE_YES; + pl.SetHealth(100); + pl.SetMaxHealth(100); + pl.SetTakedamage(DAMAGE_YES); pl.SetSolid(SOLID_SLIDEBOX); pl.SetMovetype(MOVETYPE_WALK); - pl.flags = FL_CLIENT; + pl.AddFlags(FL_CLIENT); pl.viewzoom = 1.0; - pl.model = "models/player.mdl"; - + /* if in cooperative mode, we want to respect the player model */ if (cvar("coop") == 1) { - string mymodel = infokey(pl, "model"); - if (mymodel) { - mymodel = sprintf("models/player/%s/%s.mdl", mymodel, mymodel); - if (whichpack(mymodel)) { - pl.model = mymodel; + string testModel = infokey(pl, "model"); + if (testModel) { + testModel = sprintf("models/player/%s/%s.mdl", testModel, testModel); + if (whichpack(testModel)) { + playerModel = testModel; } } } - setmodel(pl, pl.model); - - setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX); - pl.velocity = [0,0,0]; - pl.gravity = __NULL__; - pl.frame = 1; - //pl.SendEntity = Player_SendEntity; - pl.SendFlags = UPDATE_ALL; - pl.customphysics = Empty; - pl.iBleeds = TRUE; - forceinfokey(pl, "*spec", "0"); - forceinfokey(pl, "*deaths", ftos(pl.deaths)); - - /* this is where the mods want to deviate */ - entity spot; + pl.SetModel(playerModel); + pl.SetSize(VEC_HULL_MIN, VEC_HULL_MAX); + pl.ClearVelocity(); + pl.SetInfoKey("*spec", "0"); + pl.SetInfoKey("*deaths", ftos(pl.deaths)); + pl.SetCanBleed(true); if (startspot != "") { - dprint(sprintf("^3Gamerules_Spawn^7: Startspot is %s\n", startspot)); LevelDecodeParms(pl); - setorigin(pl, Landmark_GetSpot()); + pl.SetOrigin(Landmark_GetSpot()); } else { + entity spawnPoint; LevelNewParms(); - spot = find(world, ::classname, "info_player_start"); - setorigin(pl, spot.origin); - pl.angles = spot.angles; + spawnPoint = find(world, ::classname, "info_player_start"); + pl.Transport(spawnPoint.origin, spawnPoint.angles); } Weapons_RefreshAmmo(pl); @@ -113,8 +106,9 @@ HLSingleplayerRules::ImpulseCommand(NSClient bp, float num) switch (num) { case 101: player pl = (player)bp; - pl.health = 100; - pl.armor = 100; + pl.SetHealth(100); + pl.SetMaxHealth(100); + pl.SetArmor(100); pl.g_items |= ITEM_SUIT; Weapons_AddItem(pl, WEAPON_CROWBAR, -1); Weapons_AddItem(pl, WEAPON_GLOCK, -1); diff --git a/zpak001.pk3dir/scripts/surfaceproperties.txt b/zpak001.pk3dir/scripts/surfaceproperties.txt index 25d502b..99112f5 100644 --- a/zpak001.pk3dir/scripts/surfaceproperties.txt +++ b/zpak001.pk3dir/scripts/surfaceproperties.txt @@ -13,6 +13,7 @@ gs_material_glass bulletimpact "sfx_impact.glass" stepleft "step_glass.left" stepright "step_glass.right" + break "func_breakable.break_glass" } gs_material_wood @@ -22,6 +23,7 @@ gs_material_wood bulletimpact "sfx_impact.wood" stepleft "step_wood.left" stepright "step_wood.right" + break "func_breakable.break_wood" } gs_material_metal @@ -31,6 +33,7 @@ gs_material_metal bulletimpact "sfx_impact.metal" stepleft "step_metal.left" stepright "step_metal.right" + break "func_breakable.break_metal" } gs_material_ladder @@ -48,6 +51,7 @@ gs_material_flesh bulletimpact "sfx_impact.flesh" stepleft "step_flesh.left" stepright "step_flesh.right" + break "func_breakable.break_flesh" } gs_material_cinderblock @@ -56,6 +60,7 @@ gs_material_cinderblock bulletimpact "sfx_impact.concrete" stepleft "step_default.left" stepright "step_default.right" + break "func_breakable.break_cinder" } gs_material_tile @@ -65,6 +70,7 @@ gs_material_tile bulletimpact "sfx_impact.tile" stepleft "step_tile.left" stepright "step_tile.right" + break "func_breakable.break_cinder" } gs_material_computer @@ -74,6 +80,7 @@ gs_material_computer bulletimpact "sfx_impact.computer" stepleft "step_computer.left" stepright "step_computer.right" + break "func_breakable.break_computer" } gs_material_unbreakableglass @@ -82,14 +89,16 @@ gs_material_unbreakableglass bulletimpact "sfx_impact.glass" stepleft "step_glass.left" stepright "step_glass.right" + break "func_breakable.break_glass" } -gs_material_rock +gs_material_rocks { part_bulletimpact "impact_default.main" bulletimpact "sfx_impact.rock" stepleft "step_default.left" stepright "step_default.right" + break "func_breakable.break_cinder" } gs_material_flesh @@ -99,6 +108,7 @@ gs_material_flesh bulletimpact "sfx_impact.flesh" stepleft "step_flesh.left" stepright "step_flesh.right" + break "func_breakable.break_flesh" } gs_material_concrete @@ -108,6 +118,7 @@ gs_material_concrete bulletimpact "sfx_impact.concrete" stepleft "step_concrete.left" stepright "step_concrete.right" + break "func_breakable.break_cinder" } gs_material_dirt @@ -117,6 +128,7 @@ gs_material_dirt bulletimpact "sfx_impact.dirt" stepleft "step_dirt.left" stepright "step_dirt.right" + break "func_breakable.break_rocks" } gs_material_grate @@ -126,6 +138,7 @@ gs_material_grate bulletimpact "sfx_impact.grate" stepleft "step_grate.left" stepright "step_grate.right" + break "func_breakable.break_metal" } gs_material_alien @@ -135,6 +148,7 @@ gs_material_alien bulletimpact "sfx_impact.alien" stepleft "step_alien.left" stepright "step_alien.right" + break "func_breakable.break_flesh" } gs_material_snow @@ -180,4 +194,5 @@ gs_material_vent bulletimpact "sfx_impact.snow" stepleft "step_vent.left" stepright "step_vent.right" + break "func_breakable.break_metal" } \ No newline at end of file diff --git a/zpak001.pk3dir/sound/func_breakable.sndshd b/zpak001.pk3dir/sound/func_breakable.sndshd index 6d5dbe4..9b1c21f 100644 --- a/zpak001.pk3dir/sound/func_breakable.sndshd +++ b/zpak001.pk3dir/sound/func_breakable.sndshd @@ -1,70 +1,39 @@ -func_breakable.impact_glassunbreakable +func_breakable.break_cinder { - sample debris/glass1.wav - sample debris/glass2.wav - sample debris/glass3.wav - sample debris/glass4.wav + sample debris/bustconcrete1.wav + sample debris/bustconcrete2.wav } - -func_breakable.impact_computer +func_breakable.break_computer { - sample debris/glass1.wav - sample debris/glass2.wav - sample debris/glass3.wav - sample debris/glass4.wav + sample debris/bustmetal1.wav + sample debris/bustmetal2.wav } - -func_breakable.impact_glass +func_breakable.break_flesh { - sample debris/glass1.wav - sample debris/glass2.wav - sample debris/glass3.wav - sample debris/glass4.wav + sample debris/bustflesh1.wav + sample debris/bustflesh2.wav } - -func_breakable.impact_wood +func_breakable.break_glass { - sample debris/wood1.wav - sample debris/wood2.wav - sample debris/wood3.wav - sample debris/wood4.wav + sample debris/bustglass1.wav + sample debris/bustglass2.wav } - -func_breakable.impact_metal +func_breakable.break_metal { - sample debris/metal1.wav - sample debris/metal2.wav - sample debris/metal3.wav - sample debris/metal4.wav + sample debris/bustmetal1.wav + sample debris/bustmetal2.wav } - -func_breakable.impact_flesh +func_breakable.break_rocks { - sample debris/flesh1.wav - sample debris/flesh2.wav - sample debris/flesh3.wav - sample debris/flesh5.wav - sample debris/flesh6.wav - sample debris/flesh7.wav + sample debris/bustconcrete1.wav + sample debris/bustconcrete2.wav } - -func_breakable.impact_cinder +func_breakable.break_tile { - sample debris/concrete1.wav - sample debris/concrete2.wav - sample debris/concrete3.wav + sample debris/bustceiling.wav } - -func_breakable.impact_concrete +func_breakable.break_wood { - sample debris/concrete1.wav - sample debris/concrete2.wav - sample debris/concrete3.wav -} - -func_breakable.impact_rock -{ - sample debris/concrete1.wav - sample debris/concrete2.wav - sample debris/concrete3.wav -} + sample debris/bustcrate1.wav + sample debris/bustcrate2.wav +} \ No newline at end of file