This commit is contained in:
Marco Cawthorne 2025-02-01 20:35:32 -08:00
parent 1fc3e3cf9c
commit 01647c66fe
139 changed files with 2196 additions and 256 deletions

1
PAK_NAME Normal file
View file

@ -0,0 +1 @@
package_baseq2.pk3

1
PROJECT Normal file
View file

@ -0,0 +1 @@
Mayhem2

32
README.md Normal file
View file

@ -0,0 +1,32 @@
# Mayhem II
Port of id Software's Quake II. Mainly for experiencing a different version of multiplayer.
![Preview 1](img/preview1.jpg)
![Preview 2](img/preview2.jpg)
![Preview 3](img/preview3.jpg)
![Preview 4](img/preview4.jpg)
## To-do list:
- Not all monsters.
- Items lack functionality.
- Armor implementation is not as advanced.
- No own code for HUD stuff etc just decl.
## License
ISC License
Copyright (c) 2024 Marco Cawthorne <marco@icculus.org>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

BIN
csprogs.dat Normal file

Binary file not shown.

View file

@ -3,8 +3,8 @@ entityDef ammo_base
"spawnclass" "NSItem"
"snd_acquire" "ammo.pickup"
"snd_respawn" "ammo.respawn"
"mins" "-16 -16 -16"
"maxs" "16 16 16"
"mins" "-12 -12 -16"
"maxs" "12 12 16"
"renderfx" "$RM_Q2PULSE"
"rendercolor" "255 255 255"
"renderamt" "255"

View file

@ -8,4 +8,5 @@ entityDef ammo_grenades
"inherit" "ammo_base"
"model" "models/items/ammo/grenades/medium/tris.md2"
"inv_ammo_grenades" "5"
"inv_weapon" "weapon_grenade"
}

View file

@ -15,6 +15,3 @@
#include "items/health_small.def"
#include "items/adrenaline.def"
#include "items/breather.def"
// remove
#include "items/suit.def"

1
decls/def/monsters.def Normal file
View file

@ -0,0 +1 @@
#include "monsters/soldier.def"

View file

@ -0,0 +1,37 @@
#define SOLDIER_ATTAK "0,1,2,3"
#define SOLDIER_DUCK "4"
#define SOLDIER_PAIN1 "5,6,7,8"
#define SOLDIER_RUN "9,10,11"
#define SOLDIER_STAND "12,13"
#define SOLDIER_WALK "14,15"
#define SOLDIER_DEATH1 16
#define SOLDIER_DEATH2 17
#define SOLDIER_DEATH3 18
#define SOLDIER_DEATH4 19
#define SOLDIER_DEATH5 20
#define SOLDIER_DEATH6 21
entityDef monster_soldier
{
"spawnclass" "NSMonster"
"model" "models/monsters/soldier/tris.md2"
"mins" "-16 -16 -24"
"mins" "16 16 32"
"health" "100"
"bleed" "1"
"act_idle" "$SOLDIER_STAND"
"act_walk" "$SOLDIER_WALK"
"act_run" "$SOLDIER_RUN"
"act_smallFlinch" "$SOLDIER_PAIN"
"act_bigFlinch" "$SOLDIER_PAIN"
"act_twitch" "$SOLDIER_PAIN"
"act_dieViolent" "$SOLDIER_DEATH1"
"act_dieForward" "$SOLDIER_DEATH2"
"act_dieBackward" "$SOLDIER_DEATH3"
"act_dieSimple" "$SOLDIER_DEATH4"
"act_dieBackshot" "$SOLDIER_DEATH5"
"act_rangeAttack1" "$SOLDIER_ATTAK"
"eye_height" "24"
"team" "1"
"propdata" "actor_human"
}

View file

@ -1,6 +1,6 @@
entityDef player
{
"spawnclass" "HLPlayer"
"spawnclass" "NSClientPlayer"
"health" "100"
"maxarmor" "100"
"bleeds" "1"

View file

@ -0,0 +1,7 @@
entityDef projectile_bullet_base
{
"spawnclass" "NSProjectile"
"is_bullet" "1"
"decal_impact" "Impact.Shot"
"detonate_on_world" "1"
}

26
decls/def/spawns.def Normal file
View file

@ -0,0 +1,26 @@
entityDef info_player_start
{
"spawnclass" "NSSpawnPoint"
"editor_mins" "-16 -16 -36"
"editor_maxs" "16 16 36"
"editor_description" "Singleplayer Spawn Point"
"editor_color" "1 0 0"
}
entityDef info_player_deathmatch
{
"spawnclass" "NSSpawnPoint"
"editor_mins" "-16 -16 -36"
"editor_maxs" "16 16 36"
"editor_description" "Deathmatch Spawn Point"
"editor_color" "1 0 0"
}
entityDef info_player_coop
{
"spawnclass" "NSSpawnPoint"
"editor_mins" "-16 -16 -36"
"editor_maxs" "16 16 36"
"editor_description" "Cooperative Spawn Point"
"editor_color" "1 0 0"
}

View file

@ -2,7 +2,7 @@ entityDef weapon_base
{
"spawnclass" "NSWeapon"
"mins" "-16 -16 -16"
"maxs" "16 16 16"
"maxs" "16 16 32"
"spin" "1"
"renderfx" "$RM_Q2PULSE"
"rendercolor" "255 255 255"

View file

@ -27,6 +27,7 @@ entityDef weapon_bfg
"snd_fire" "weapon_bfg.fire"
// NSWeapon specific
"ammoIcon" "pics/a_cells.pcx"
"hudSlot" "9"
"weight" "10"
}

View file

@ -15,7 +15,7 @@ entityDef weapon_blaster
"def_onFire" "projectile_blaster"
"inv_name" "Blaster"
"ammoRequired" "0"
"punchAngle" "-2 0 0"
"punchAngle" "-1 0 0"
"act_fire" "1"
"act_holster" "4"
@ -25,6 +25,7 @@ entityDef weapon_blaster
"snd_fire" "weapon_blaster.fire"
// NSWeapon specific
"ammoIcon" "pics/a_blaster.pcx"
"hudSlot" "0"
"weight" "10"
}
@ -46,9 +47,10 @@ entityDef projectile_blaster
"impact_gib" "1"
"smoke_fly" "q2part.TR_BLASTERTRAIL"
"decal_detonate" "ExplosionScorch"
"decal_detonate" "Impact.BigShot"
"model_detonate" "q2part.teq2_blaster"
"light_color" "1 1 0"
"detonate_offset" "1"
"light_color" "1 0.5 0"
"light_radius" "160"
"light_offset" "0 0 0"
"damage" "15"

View file

@ -17,7 +17,7 @@ entityDef weapon_chaingun
"ammoType" "ammo_bullets"
"ammoRequired" "1"
"ammoPerShot" "1"
"punchAngle" "-2 0 0"
"punchAngle" "-1.5 0 0"
"inv_ammo_bullets" "50"
"fireRate" "0.05"
@ -29,6 +29,7 @@ entityDef weapon_chaingun
"snd_fire" "weapon_chaingun.fire"
// NSWeapon specific
"ammoIcon" "pics/a_bullets.pcx"
"hudSlot" "4"
"weight" "10"
}

View file

@ -17,7 +17,7 @@ entityDef weapon_grenadelauncher
"ammoType" "ammo_grenades"
"ammoRequired" "1"
"ammoPerShot" "1"
"punchAngle" "-2 0 0"
"punchAngle" "-1 0 0"
"inv_ammo_grenades" "5"
"act_draw" "0"
@ -28,6 +28,7 @@ entityDef weapon_grenadelauncher
"snd_fire" "weapon_grenadelauncher.fire"
// NSWeapon specific
"ammoIcon" "pics/a_grenades.pcx"
"hudSlot" "5"
"weight" "10"
}

View file

@ -11,12 +11,13 @@ entityDef weapon_grenade
"model_view" "models/weapons/v_handgr/tris.md2"
// weapon specific
"def_onRelease" "projectile_grenade"
"def_onRelease" "projectile_handgrenade"
"inv_name" "Grenade launcher"
"ammoType" "ammo_grenades"
"ammoRequired" "1"
"ammoPerShot" "1"
"punchAngle" "-2 0 0"
"inv_ammo_grenades" "5"
"act_fire" "0"
"act_release" "1"
@ -27,6 +28,7 @@ entityDef weapon_grenade
"snd_fire" "weapon_grenadelauncher.fire"
// NSWeapon specific
"ammoIcon" "pics/a_grenades.pcx"
"hudSlot" "5"
"weight" "10"
}

View file

@ -26,6 +26,8 @@ entityDef weapon_hyperblaster
"snd_fire" "weapon_hyperblaster.fire"
// NSWeapon specific
"ammoIcon" "pics/a_cells.pcx"
"hudSlot" "7"
"weight" "10"
}

View file

@ -24,6 +24,9 @@ entityDef weapon_machinegun
"act_holster" "3"
"inv_ammo_bullets" "50"
"snd_fire" "weapon_machinegun.fire"
//NSWeapon specific
"ammoIcon" "pics/a_bullets.pcx"
"hudSlot" "3"
"weight" "10"
}

View file

@ -16,7 +16,7 @@ entityDef weapon_railgun
"ammoType" "ammo_slugs"
"ammoRequired" "1"
"ammoPerShot" "1"
"punchAngle" "-2 0 0"
"punchAngle" "-3 0 0"
"act_draw" "0"
"act_fire" "1"
@ -24,9 +24,12 @@ entityDef weapon_railgun
"act_holster" "3"
"inv_ammo_slugs" "10"
"snd_fire" "weapon_railgun.fire"
"snd_fire" "weapon_railgun.fire"
// NSWeapon specific
"ammoIcon" "pics/a_cells.pcx"
"hudSlot" "8"
"weight" "10"
}
entityDef projectile_railgun

View file

@ -17,7 +17,7 @@ entityDef weapon_rocketlauncher
"ammoType" "ammo_rockets"
"ammoRequired" "1"
"ammoPerShot" "1"
"punchAngle" "-2 0 0"
"punchAngle" "-1 0 0"
"act_draw" "0"
"act_fire" "1"
@ -28,6 +28,7 @@ entityDef weapon_rocketlauncher
"snd_fire" "weapon_rocketlauncher.fire"
// NSWeapon specific
"ammoIcon" "pics/a_rockets.pcx"
"hudSlot" "6"
"weight" "10"
}
@ -36,7 +37,7 @@ entityDef projectile_rocket
{
"spawnclass" "NSProjectile"
"model" "models/objects/rocket/tris.md2"
"offset" "24 0 -8"
"offset" "24 4 -8"
"velocity" "1000"
"angular_velocity" "0 0 200"
@ -54,12 +55,29 @@ entityDef projectile_rocket
"smoke_fly" "q2part.trq2_rocket"
"decal_detonate" "ExplosionScorch"
"model_detonate" "q2part.teq2_rocket_explosion"
"detonate_offset" "24"
"light_color" "1 0.8 0.4"
"light_radius" "160"
"light_offset" "0 0 0"
"snd_explode" "weapon_rocketlauncher.explode"
"def_damage" "damage_rocketDirect"
"def_splash_damage" "damage_rocketSplash"
}
entityDef damage_rocketDirect
{
"damage" "100"
"knockback" "300"
"push" "45000"
"gib" "1"
}
entityDef damage_rocketSplash
{
"knockback" "300"
"damage_min" "60"
"damage" "120"
"radius" "120"
"push" "10000"
"gib" "0"
}

View file

@ -14,28 +14,29 @@ entityDef weapon_shotgun
// weapon specific
"def_onFire" "projectile_shotgun"
"inv_name" "Shotgun"
"ammoType" "ammo_shells"
"ammoRequired" "1"
"ammoType" "ammo_shells"
"ammoRequired" "1"
"ammoPerShot" "1"
"punchAngle" "-2 0 0"
"inv_ammo_shells" "10"
"act_draw" "0"
"act_fire" "1"
"act_idle" "2"
"act_draw" "0"
"act_fire" "1"
"act_idle" "2"
"act_holster" "3"
"snd_fire" "weapon_shotgun.fire"
"snd_fire" "weapon_shotgun.fire"
// NSWeapon specific
"hudSlot" "1"
"weight" "10"
"ammoIcon" "pics/a_shells.pcx"
"hudSlot" "1"
"weight" "10"
}
entityDef projectile_shotgun
{
"inherit" "projectile_bullet_base"
"damage" "4"
"hitscans" "12"
"spread" "0.1220703125 0.06103515625"
"inherit" "projectile_bullet_base"
"damage" "4"
"hitscans" "12"
"spread" "0.1220703125 0.06103515625"
}

View file

@ -28,6 +28,7 @@ entityDef weapon_supershotgun
"snd_empty" "weapon.empty"
// NSWeapon specific
"ammoIcon" "pics/a_shells.pcx"
"hudSlot" "2"
"weight" "10"
}

View file

@ -0,0 +1,61 @@
step_default.left
{
attenuation static
footstep
sample player/step1.wav
sample player/step2.wav
}
step_default.right
{
attenuation static
footstep
sample player/step3.wav
sample player/step4.wav
}
step_slosh.left
{
attenuation static
footstep
sample player/wade1.wav
sample player/wade2.wav
sample player/wade3.wav
}
step_slosh.right
{
attenuation static
footstep
sample player/wade1.wav
sample player/wade2.wav
sample player/wade3.wav
}
step_ladder.left
{
}
step_ladder.right
{
}
step_wade.left
{
sample player/wade1.wav
sample player/wade2.wav
sample player/wade3.wav
}
step_wade.right
{
sample player/wade1.wav
sample player/wade2.wav
sample player/wade3.wav
}
step_swim.left
{
}
step_swim.right
{
}

View file

@ -1,3 +1,10 @@
sfx_impact.default
{
sample "world/ric1.wav"
sample "world/ric2.wav"
sample "world/ric3.wav"
}
sfx_impact.bfg
{
alerts

62
decls/sound/player.sndshd Normal file
View file

@ -0,0 +1,62 @@
Player.Wade
{
sample "player/wade1.wav"
sample "player/wade2.wav"
sample "player/wade3.wav"
}
Player.LightFall
{
sample "player/land1.wav"
}
Player.FallDamage
{
sample "player/land1.wav"
}
Player.WaterEnter
{
sample "player/watr_in.wav"
}
Player.GaspLight
{
sample "player/gasp1.wav"
}
Player.GaspHeavy
{
sample "player/gasp2.wav"
}
Player.Death
{
sample "player/male/death1.wav"
sample "player/male/death2.wav"
sample "player/male/death3.wav"
sample "player/male/death4.wav"
}
Player.Drown
{
sample "player/male/drown1.wav"
}
Player.Pain
{
sample "player/male/pain50_1.wav"
sample "player/male/pain50_2.wav"
}
Player.Swim
{
sample "player/wade1.wav"
sample "player/wade2.wav"
sample "player/wade3.wav"
}
Player.WaterExit
{
sample "player/watr_out.wav"
}

40
default_baseq2.cfg Normal file
View file

@ -0,0 +1,40 @@
set con_color "0 255 0"
set cross_color "0 255 0"
set fov "90"
set hostname "Mayhem II Server"
set maxplayers "8"
set pm_accelerate "10"
set pm_airaccelerate "10"
set pm_airstepsize "0"
set pm_boxcenter "1"
set pm_boxwidth "32"
set pm_crouchheight "28"
set pm_crouchspeed "90"
set pm_crouchviewheight "22"
set pm_edgefriction "1"
set pm_friction "6"
set pm_gravity "800"
set pm_jumpheight "270"
set pm_maxviewpitch "89"
set pm_minviewpitch "-89"
set pm_noclipaccelerate "5"
set pm_noclipspeed "500"
set pm_normalheight "56"
set pm_normalviewheight "46"
set pm_nospeedcap "0"
set pm_proneheight "0"
set pm_pronespeed "0"
set pm_proneviewheight "0"
set pm_runspeed "0"
set pm_stairSmoothing "1"
set pm_stamina "0"
set pm_staminarate "0"
set pm_staminathreshold "0"
set pm_stepsize "18"
set pm_stopspeed "100"
set pm_thirdPerson "0"
set pm_walkspeed "300"
set pm_wateraccelerate "10"
set pm_waterjumpheight "270"
set r_imageextensions "pcx wal tga"
set vgui_color "0 255 0"

39
default_controls.cfg Normal file
View file

@ -0,0 +1,39 @@
unbindall
bind CTRL "+duck"
bind DOWNARROW "+back"
bind ESCAPE "togglemenu"
bind F1 "vote yes"
bind F2 "vote no"
bind LEFTARROW "+left"
bind MOUSE1 "+attack"
bind MOUSE2 "+attack2"
bind MWHEELDOWN "invnext"
bind MWHEELUP "invprev"
bind RIGHTARROW "+right"
bind SHIFT "+speed"
bind SPACE "+jump"
bind TAB "+showscores"
bind UPARROW "+forward"
bind 0 "slot10"
bind 1 "slot1"
bind 2 "slot2"
bind 3 "slot3"
bind 4 "slot4"
bind 5 "slot5"
bind 6 "slot6"
bind 7 "slot7"
bind 8 "slot8"
bind 9 "slot9"
bind ` "toggleconsole"
bind a "+moveleft"
bind d "+moveright"
bind e "+use"
bind f "impulse 100"
bind r "+reload"
bind s "+back"
bind t "impulse 201"
bind u "messagemode2"
bind w "+forward"
bind y "messagemode"
bind q "weaplast"
bind ~ "toggleconsole"

188
default_cvar.cfg Normal file
View file

@ -0,0 +1,188 @@
// generated by Nuclide, do not modify
set _pext_infoblobs "1" // override
set _pext_vrinputs "0" // override
set _q3bsp_bihtraces "1" // override
set ai_debugAlerts "0" // Show prints when AI gets alerted to a position.
set ai_debugLogic "0" // Show prints when AI makes decisions regarding thinking.
set ai_debugNav "0" // Show prints when AI makes decisions regarding navigation.
set ai_debugScripts "0" // Show prints when AI interacts with scripted sequences.
set ai_enable "1" // Disable AI behaviour when set.
set ai_runSpeed "320" // Default run speed chosen by AI characters, in units per second.
set ai_walkSpeed "150" // Default walk speed chosen by AI characters, in units per second.
set bot_aimless "0" // Bots will not set goals for themselves when set.
set bot_backspeed "133" // Bots desired maximum backwards speed.
set bot_crouch "0" // Bots are all forced to move crouched.
set bot_developer "0" // TODO: remove?
set bot_dont_shoot "0" // Bots never actually shoot.
set bot_enable "1" // Bot support enabled when set.
set bot_fastChat "0" // Bots will chat instantly instead of 'typing'.
set bot_forwardspeed "190" // Bots desired maximum forward speed.
set bot_minClients "-1" // How many player slots are to be filled, -1 is 'untouched'.
set bot_noChat "0" // Bots will no longer communicate when set.
set bot_pause "0" // Bots logic will be paused.
set bot_prefix "" // Bot nickname prefix for newly added bots.
set bot_prone "0" // Bots are all forced to move prone.
set bot_sidespeed "152" // Bots desired maximum strafe speed.
set bot_skill "2" // Bot version of cvar "skill".
set bot_walk "0" // Bots are forced to walk slowly.
set cfg_save_auto "1" // override
set cg_chatEnabled "1" // Enable the display of chat messages.
set cg_damageShake "0" // Shake the display upon taking damage.
set cg_hudAspect "0" // Aspect ratio override for the HUD. 1.0 is 1:1 square, 0 is auto.
set cg_modelBobHeight "0.0" // Intensity at which objects with the "spin" flag bob.
set cg_modelBobHeightSpeed "0.0" // Speed at which objects with the "spin" flag bob.
set cg_modelSpinPitch "0.0" // Intensity at which objects with the "spin" flag change their pitch.
set cg_modelSpinPitchSpeed "0.0" // Speed at which objects with the "spin" flag change their pitch.
set cg_modelSpinRoll "0.0" // Intensity at which objects with the "spin" flag roll.
set cg_modelSpinRollSpeed "0.0" // Speed at which objects with the "spin" flag roll.
set cg_modelSpinSpeed "120.0" // Speed at which an object with the "spin" key spins.
set cg_muzzleDLight "1" // Enable dlights being spawned from muzzleflashes.
set cg_muzzleDLightColor "1.0 0.45 0.0" // Color of muzzleflash dlights.
set cg_viewZSmoothingMax "16" // Camera vertical-axis smoothing max delta threshold.
set cg_viewZSmoothingMin "1" // Camera vertical-axis smoothing delta threshold.
set cg_viewZSmoothingTime "0.1" // Camera vertical-axis smoothing steps.
set cg_viewmodelFlip "0" // Flip the viewmodel.
set cg_viewmodelFov "90" // Viewmodel field of view.
set cg_viewmodelLag "0" // Viewmodel lag when camera looks around.
set cg_viewmodelOffset "0 0 0" // Viewmodel offset in relative units (forward, right, up)
set cg_viewmodelPass "1" // Renders viewmodel in separate drawpass (no lighting)
set cg_viewmodelScale "1.0" // Viewmodel scale multiplier, affects bob as well.
set cl_backspeed "400" // Client's desired backwards speed.
set cl_bob "0" // override
set cl_cursor_scale "1" // override
set cl_decals "128" // override
set cl_forwardspeed "400" // Client's desired forward speed.
set cl_musicstyle "0" // override
set cl_sidespeed "400" // Client's desired side-step speed.
set con_color "255 150 0" // HUD color value, R G B, 0-255 for each channel.
set con_notifylines "0" // override
set dev_cornerspeed "0" // Override speed set by path_corner entities.
set dev_loddistance "0" // Override distance at which func_lod entities disappear.
set dev_skyscale "" // Override for the sky_camera room scale.
set dsp_soundscapes "1" // Enable the use of sound scapes.
set g_damageScale "1" // final damage scale on objects
set g_gravity "800" // Global gravity setting.
set g_logLevel "2" // Game console log levels. 0 = None, 1 = Errors, 2 = Warnings, 3 = Extra Messages
set g_logTimestamps "0" // When 1, will print time stamps before the log message
set gl_conback "gfx/devcon" // override
set gl_mindist "4" // override
set gl_blendsprites "0" // override
set gl_specular "1" // override
set gl_specular_fallback "0" // override
set in_zoomSensitivity "1.0" // Input sensitivity multiplier for when you're zoomed in.
set logging_enabled "0" // Enable server-side logging for game specific events.
set maxpitch "89" // override
set menu_helptext_size "11"
set menu_intro "1"
set menu_steambg "0"
set menu_updating "0"
set media_repeat "0" // override
set minpitch "-89" // override
set motdfile "motd.txt"
set mp_allowvote "1"
set mp_decals "128"
set mp_flashlight "1"
set mp_td_dmgToKick "300"
set mp_td_dmgToWarn "200"
set nav_linksize "256"
set nav_radius "32"
set phys_developer "0" // Shows debug prints regarding physics operations when set.
set phys_impactforcescale "1" // Scaler for impact forces on physically simulated entities.
set phys_pushscale "1" // Scaler for push forces on physically simulated entities.
set pm_accelerate "10"
set pm_airaccelerate "10"
set pm_airstepsize "0"
set pm_boxcenter "1"
set pm_boxwidth "32"
set pm_crouchheight "36"
set pm_crouchspeed "90"
set pm_crouchviewheight "30"
set pm_edgefriction "1"
set pm_friction "4"
set pm_gravity "800"
set pm_jumpheight "265"
set pm_maxviewpitch "89"
set pm_minviewpitch "-89"
set pm_noclipaccelerate "5"
set pm_noclipspeed "500"
set pm_normalheight "72"
set pm_normalviewheight "64"
set pm_nospeedcap "0"
set pm_proneheight "0"
set pm_pronespeed "40.5"
set pm_proneviewheight "16"
set pm_runspeed "0"
set pm_runfiring "1"
set pm_stairSmoothing "1"
set pm_stamina "24"
set pm_staminarate "0.75"
set pm_staminathreshold "4"
set pm_stepsize "18"
set pm_stopspeed "100"
set pm_thirdPerson "0"
set pm_walkspeed "270"
set pm_wateraccelerate "10"
set pm_waterjumpheight "350"
set r_autoscale "1" // When set, will ensure the game is at 640x480 type scaling.
set r_drawdecals "1" // Shows decal entities managed by the game when set.
set r_ignoreentpvs "0" // override
set r_imageextensions "tga bmp pcx png jpg" // override
set r_meshpitch "1" // override
set r_pixelscale "0" // When set, will ensure the 3D rendered scene is restricted to 640x480 resolution in definition.
set r_renderEntityInfo "0" // Display visual information about entities in-world.
set r_showDlights "0" // Displays dynamic light representations in-world.
set r_showPhysicsInfo "0" // Displays physics entity information in-world.
set r_skipGlows "0" // Skip rendering of glowing sprites.
set r_skipLensFlares "0" // Skip rendering of lens flares.
set r_skipWorld "0" // Skip rendering of the world.
set rm_unlit_additive "1" // Render entities with the 'additive' rendermode fullbright.
set rm_unlit_texture "1" // Render entities with the 'texture' rendermode fullbright.
set rope_debug "0" // Shows primitive debug rendering of a rope when set.
set rope_fast "1" // Don't perform expensive calculations on the rope when set.
set rope_maxsegments "-1" // Limit rope segments. -1 means no limit.
set rope_sag "2" // Rope sagging multiplier.
set rope_swing "2" // Rope swinging multiplier.
set s_logLevel "2" // Sound console log levels. 0 = None, 1 = Errors, 2 = Warnings, 3 = Extra Messages
set scr_conalpha "1" // override
set scr_loadingscreen_aspect "1" // override
set sp_decals "128"
set sv_friendlyFire "0" // Team-inflicted damage is possible when set.
set sv_gameplayfix_setmodelrealbox "1" // override
set sv_gameplayfix_setmodelsize_qw "1" // override
set sv_levelexec "1" // Will search and execute `<gamedir>/maps/currentmap.cfg` when set.
set sv_plugins "1" // Enable the use of server-side plugins when set.
set v_contentblend "0" // override
set vehicle_developer "0" // Shows vehicle related debug prints when set.
set vgui_color "255 170 0" // Default primary color for VGUI widgets.
set vid_brightness "0" // Controls display brightness.
set violence_ablood "1" // Enable non-human (alternative) blood.
set violence_agibs "1" // Enable non-human (alternative) gibs.
set violence_hblood "1" // Enable human blood.
set violence_hgibs "1" // Enable human giblets.
set xr_roomScale "1.0" // XR: Room scale multiplier.
set xr_testInputs "0" // XR: Enable fake inputs, to debug the VR camera and weapon inputs.
set xr_viewHeight "-48" // XR: Default view-height offset.
set physics_ode_quadtree_depth "3" // override
set physics_ode_contactsurfacelayer "0" // override
set physics_ode_worldquickstep "1" // override
set physics_ode_worldquickstep_iterations "10" // was 20, too much
set physics_ode_contact_mu "1" // override
set physics_ode_contact_erp "0.96" // override
set physics_ode_contact_cfm "0.001" // override
set physics_ode_world_damping "-1" // override
set physics_ode_world_damping_linear "-1" // override
set physics_ode_world_damping_linear_threshold "-1" // override
set physics_ode_world_damping_angular "-1" // override
set physics_ode_world_damping_angular_threshold "-1" // override
set physics_ode_world_erp "0.96" // override
set physics_ode_world_cfm "0.001" // override
set physics_ode_iterationsperframe "1" // override
set physics_ode_movelimit "1.0" // override
set physics_ode_spinlimit "1300" // was 2000
set physics_ode_autodisable "1" // override
set physics_ode_autodisable_steps "5" // override
set physics_ode_autodisable_time "0.1" // override
set physics_ode_autodisable_threshold_linear "0.05" // Was 0.2, too lenient.
set physics_ode_autodisable_threshold_angular "0.01" // override
set physics_ode_autodisable_threshold_samples "5" // override
set physics_ode_maxspeed "800" // was 0

11
default_video.cfg Normal file
View file

@ -0,0 +1,11 @@
set gl_overbright 0
set gl_overbright_models 0
set gl_overbright_all 0
set r_lightmap_format rgb8
set gl_halflambert 1
set gl_ldr 1
set gamma 1.0
set brightness 0.0
set r_nolerp 0
set r_noframegrouplerp 0
set vid_srgb 0

2
fonts/chat.font Normal file
View file

@ -0,0 +1,2 @@
path "pics/conchars.pcx"
size 8

2
fonts/font16.font Normal file
View file

@ -0,0 +1,2 @@
path "pics/conchars.pcx"
size 8

2
fonts/font20.font Normal file
View file

@ -0,0 +1,2 @@
path "pics/conchars.pcx"
size 8

2
fonts/fontcon.font Normal file
View file

@ -0,0 +1,2 @@
path "pics/conchars.pcx"
size 8

2
fonts/ui.font Normal file
View file

@ -0,0 +1,2 @@
path "pics/conchars.pcx"
size 8

5
gfx/background.mat Normal file
View file

@ -0,0 +1,5 @@
{
{
map "pics/conback.pcx"
}
}

54
liblist.gam Normal file
View file

@ -0,0 +1,54 @@
// window title
game "Mayhem II (Quake II)"
// main game directory
gamedir "baseq2"
// folder to also include in the path (before game dir)
fallback_dir ""
// first folder to include, before gamedir and fallback_dir
base_dir ""
// author information
url_info "www.frag-net.com"
// download location (.zip/pk3)
url_dl
// version string
version "1.0"
// size of game in bytes
size 10519918
// whether this game is only for dedicated servers
svonly 0
// whether this game has a client-side progs
cldll 1
// if we're singleplayer, multiplayer or both
type "Both"
// minimum game-revision required to play
minversion 0
// if we should show player model selection in the multiplayer options
nomodels 1
// if we should allow spraylogos in the multiplayer options
nosprays 0
// name of the entity used for multiplayer map identifcation
mpentity "info_player_deathmatch"
// which server progs.dat to use
gamedll "progs.dat"
// which map we'll start a new singleplayer game on
startmap "base1"
// which map the training button will go to
trainingmap ""
// names of the packages this game needs
pkgname ""
// name of file inside the packages we should check for
pkgfile ""
// which chat-room to join by default
chatroom "quake"
// which file is to view when clicking the readme menu button
readme "readme.txt"
// which map to use as a level background
menumap ""
// what movie to play when starting the game
introvideo ""
// whether to use a steam styled resource background cut into multiple parts
steambg 0
// the title text of the game
title "Mayhem II"
// the subtitle of the game
subtitle ""

BIN
menu.dat Normal file

Binary file not shown.

View file

@ -0,0 +1,22 @@
0 12 10 0
12 17 10 0
30 9 10 0
39 6 10 0
45 5 10 0
50 5 10 0
55 6 10 0
62 18 10 0
80 17 10 0
97 12 10 1
109 18 10 1
127 19 10 1
146 30 10 0
176 39 10 0
215 33 10 1
248 24 10 1
272 36 10 0
308 35 10 0
343 45 10 0
388 53 10 0
441 24 10 0
465 10 10 0

BIN
progs.dat Normal file

Binary file not shown.

BIN
progs/deathmatch.dat Normal file

Binary file not shown.

BIN
progs/singleplayer.dat Normal file

Binary file not shown.

4
quake.rc Normal file
View file

@ -0,0 +1,4 @@
exec default_cvar.cfg
exec default_controls.cfg
exec default_video.cfg
exec default_baseq2.cfg

12
scripts/bots.txt Normal file
View file

@ -0,0 +1,12 @@
{
name Athena
model female
topcolor 0xeff
bottomcolor 0xff0020
}
{
name Howitzer
model male
topcolor 0xeff
bottomcolor 0xff0020
}

13
scripts/hud.shader Normal file
View file

@ -0,0 +1,13 @@
gfx/hud/health
{
{
map pics/i_health.pcx
}
}
gfx/hud/armor
{
{
map pics/i_combatarmor.pcx
}
}

39
scripts/map_blacklist Normal file
View file

@ -0,0 +1,39 @@
base1.bsp
base2.bsp
base3.bsp
train.bsp
bunk1.bsp
ware1.bsp
ware2.bsp
jail1.bsp
jail2.bsp
jail3.bsp
jail4.bsp
jail5.bsp
security.bsp
mintro.bsp
mine1.bsp
mine2.bsp
mine3.bsp
mine4.bsp
fact1.bsp
fact2.bsp
fact3.bsp
power1.bsp
power2.bsp
cool1.bsp
waste1.bsp
waste2.bsp
waste3.bsp
biggun.bsp
hangar1.bsp
hangar2.bsp
lab.bsp
command.bsp
strike.bsp
space.bsp
city1.bsp
city2.bsp
city3.bsp
boss1.bsp
boss2.bsp

26
scripts/propdata.txt Normal file
View file

@ -0,0 +1,26 @@
"PropData.txt"
{
"actor_human"
{
"breakable_model" "gibs_human"
"breakable_count" "6"
}
"BreakableModels"
{
"gibs_human"
{
"models/objects/gibs/head/tris.md2" "5.0"
"models/objects/gibs/leg/tris.md2" "5.0"
"models/objects/gibs/sm_metal/tris.md2" "5.0"
"models/objects/gibs/head2/tris.md2" "5.0"
"models/objects/gibs/gear/tris.md2" "5.0"
"models/objects/gibs/sm_meat/tris.md2" "5.0"
"models/objects/gibs/arm/tris.md2" "5.0"
"models/objects/gibs/chest/tris.md2" "5.0"
"models/objects/gibs/bone2/tris.md2" "5.0"
"models/objects/gibs/skull/tris.md2" "5.0"
"models/objects/gibs/bone/tris.md2" "5.0"
}
}
}

View file

@ -0,0 +1,31 @@
default
{
part_bulletimpact "q2part.teq2_gunshot"
bulletimpact "sfx_impact.default"
stepleft "step_default.left"
stepright "step_default.right"
}
water
{
part_bulletimpact "fx_impact.water"
bulletimpact "sfx_impact.slosh"
stepleft "step_slosh.left"
stepright "step_slosh.right"
}
lava
{
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.slosh"
stepleft "step_slosh.left"
stepright "step_slosh.right"
}
slime
{
part_bulletimpact "impact_default.main"
bulletimpact "sfx_impact.slosh"
stepleft "step_slosh.left"
stepright "step_slosh.right"
}

1
scripts/ui_style.txt Normal file
View file

@ -0,0 +1 @@
NOICONS=1

7
src/Makefile Normal file
View file

@ -0,0 +1,7 @@
QCC=fteqcc
all:
cd client && $(MAKE)
cd server && $(MAKE)
cd menu && $(MAKE)
cd rules && $(MAKE)

4
src/client/Makefile Normal file
View file

@ -0,0 +1,4 @@
QCC=fteqcc
all:
$(QCC) $(CFLAGS) -I../../../src/platform/ progs.src

23
src/client/defs.h Normal file
View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2016-2022 Vera Visions LLC.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
vector g_hudmins;
vector g_hudres;
struct
{
float temp;
} g_seatslocal[4], *pSeatLocal;

59
src/client/hud.qc Normal file
View file

@ -0,0 +1,59 @@
#pragma PROGS_DAT "../../hud.dat"
#include "../../../src/client/api.h"
const float baseIconSize = 32.0;
const float baseIconPadding = 16.0;
font_s FONT_HUD;
var string g_ammoPic;
void
HUD_Init(void)
{
font.Load("fonts/font16.font", FONT_HUD);
g_ammoPic = 0;
}
void
HUD_Draw(void)
{
vector hud_mins = screen.HUDMins();
vector hud_size = screen.HUDSize();
vector hudSize = hud_size;
vector iconPos = hud_mins + (hudSize / 2);
iconPos[1] = (hudSize[1] - baseIconSize) - baseIconPadding;
string healthValue = ftos(player.GetHealth());
string armorValue = ftos(player.GetArmor());
string ammoValue = ftos(weapon.GetAmmo1());
/* ammo */
if (weapon.AmmoRequired() == true) {
draw.RText([hudSize[0] - baseIconPadding - baseIconSize - baseIconPadding, iconPos[1]], ammoValue, FONT_HUD);
}
if (g_ammoPic != "") {
draw.Pic([hudSize[0] - baseIconPadding - baseIconSize, iconPos[1]], g_ammoPic, [baseIconSize, baseIconSize], [1,1,1], 1.0f);
}
/* health, armor icons */
draw.RText(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)) - baseIconPadding, 0], healthValue, FONT_HUD);
draw.Pic(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)), 0], "gfx/hud/health", [baseIconSize, baseIconSize], [1,1,1], 1.0f);
draw.Text(iconPos + [(baseIconSize/2) + (baseIconPadding/2) + baseIconSize + baseIconPadding, 0], armorValue, FONT_HUD);
draw.Pic(iconPos + [(baseIconSize/2) + (baseIconPadding/2), 0], "gfx/hud/armor", [baseIconSize, baseIconSize], [1,1,1], 1.0f);
}
void
HUD_DrawSpectator(vector hud_mins, vector hud_size)
{
}
void
HUD_WeaponSwitched(string weaponName)
{
g_ammoPic = entityDef.GetString(weaponName, "ammoIcon");
}

482
src/client/main.qc Normal file
View file

@ -0,0 +1,482 @@
/*
* Copyright (c) 2016-2021 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
struct
{
float m_flSpeed;
float m_flFracSin;
float m_flTime;
float m_flMove;
float m_flDelta;
int m_iCycle;
} g_camBobVars[4], *pCamBob;
/* tilts the camera for a head-bob like effect when moving */
vector
Camera_RunBob(vector camera_angle)
{
if (!autocvar(v_cambob, 1, "Enables bobbing effect for the first-person camera"))
return camera_angle;
int s = (float)getproperty(VF_ACTIVESEAT);
pCamBob = &g_camBobVars[s];
/* we don't really care about the vertical velocity */
vector speed = pSeat->m_vecPredictedVelocity;
speed[2] = 0.0f;
pCamBob->m_flSpeed = vlen(speed);
if (pCamBob->m_flSpeed > 330.0f)
pCamBob->m_flSpeed = 330.0f;
/* don't bother on low speeds */
if ( pCamBob->m_flSpeed < 5.0f ) {
pCamBob->m_flMove = 0.0f;
pCamBob->m_flTime = 0.0f; /* progress has halted, start anew */
return camera_angle;
} else {
pCamBob->m_flMove = frametime * (pCamBob->m_flSpeed * 0.01);
}
pCamBob->m_flTime = (pCamBob->m_flTime += pCamBob->m_flMove);
pCamBob->m_flFracSin = fabs(sin(pCamBob->m_flTime * M_PI));
pCamBob->m_iCycle = (int)pCamBob->m_flTime;
pCamBob->m_flDelta = (pCamBob->m_flFracSin * 0.0025f) * pCamBob->m_flSpeed;
camera_angle[0] += pCamBob->m_flDelta;
if (pCamBob->m_iCycle & 1) {
pCamBob->m_flDelta = -pCamBob->m_flDelta;
}
camera_angle[2] += pCamBob->m_flDelta;
return camera_angle;
}
/* applies a tilt to the camera for when we're strafing left to right */
vector
Camera_StrafeRoll(vector camera_angle)
{
if (!autocvar(v_camroll, 0, "Enables strafe-roll for the first-person camera"))
return camera_angle;
float roll;
makevectors(camera_angle);
roll = dotproduct(pSeat->m_vecPredictedVelocity, v_right);
roll *= 0.015f;
camera_angle[2] += roll;
return camera_angle;
}
int
ClientGame_ConsoleCommand(void)
{
switch(argv(0)) {
default:
return (0);
}
return (1);
}
void
ClientGame_PreDraw(void)
{
}
void
ClientGame_PostDraw(void)
{
}
int
ClientGame_EntityUpdate(float id, float new)
{
switch (id) {
default:
return (0);
}
return (1);
}
int
ClientGame_EventParse(float fHeader)
{
switch (fHeader) {
default:
return (0);
}
return (1);
}
void
ClientGame_Init(float apilevel, string enginename, float engineversion)
{
}
void
ClientGame_InitDone(void)
{
}
void
ClientGame_RendererRestart(string rstr)
{
}
#define SCORE_HEADER_C [255/255,156/255,0]
#define SCORE_LINE_C [255/255,200/255,0]
var int autocvar_cl_centerscores = FALSE;
var int g_scores_teamplay = 0;
void
Scores_Init(void)
{
g_scores_teamplay = (int)serverkeyfloat("teamplay");
}
void
Scores_DrawTeam(ncPlayer pl, vector pos)
{
drawfill(pos, [290, 1], SCORE_LINE_C, 1.0f, DRAWFLAG_ADDITIVE);
drawfont = Font_GetID(FONT_20);
drawstring(pos + [0,-18], "Teams", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [124,-18], "kills / deaths", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [240,-18], "latency", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
pos[1] += 12;
for (int t = 1; t <= serverkeyfloat("teams"); t++) {
float l;
string temp;
drawstring(pos, serverkey(sprintf("team_%i", t)), [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
temp = serverkey(sprintf("teamscore_%i", t));
l = stringwidth(temp, FALSE, [8,8]);
drawstring(pos + [150-l, 0], temp, [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [158, 0], "wins", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
pos[1] += 16;
for (int i = -1; i > -32; i--) {
if (getplayerkeyfloat(i, "*team") != t) {
continue;
}
temp = getplayerkeyvalue(i, "name");
/* Out of players */
if (!temp) {
break;
} else if (temp == getplayerkeyvalue(pl.entnum-1, "name")) {
drawfill(pos, [290, 13], [0,0,1], 0.5f, DRAWFLAG_ADDITIVE);
}
drawstring(pos + [24,0], getplayerkeyvalue(i, "name"), [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [154,0], "/", [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
/* Get the kills and align them left to right */
temp = getplayerkeyvalue(i, "frags");
l = stringwidth(temp, FALSE, [8,8]);
drawstring(pos + [150 - l,0], temp, [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
/* Deaths are right to left aligned */
temp = getplayerkeyvalue(i, "*deaths");
drawstring(pos + [165,0], temp, [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
/* Get the latency and align it left to right */
temp = getplayerkeyvalue(i, "ping");
l = stringwidth(temp, FALSE, [8,8]);
drawstring(pos + [290 - l,0], temp, [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
pos[1] += 20;
}
pos[1] += 12;
}
drawfont = Font_GetID(FONT_CON);
}
void
Scores_DrawNormal(ncPlayer pl, vector pos)
{
drawfill(pos, [290, 1], SCORE_LINE_C, 1.0f, DRAWFLAG_ADDITIVE);
drawfont = Font_GetID(FONT_20);
drawstring(pos + [0,-18], "Player", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [124,-18], "kills / deaths", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [240,-18], "latency", [8,8], SCORE_HEADER_C, 1.0f, DRAWFLAG_ADDITIVE);
pos[1] += 12;
for (int i = -1; i > -32; i--) {
float l;
string ping;
string kills;
string deaths;
string name;
name = getplayerkeyvalue(i, "name");
/* Out of players */
if (!name) {
break;
} else if (name == getplayerkeyvalue(pl.entnum-1, "name")) {
drawfill(pos, [290, 13], [0,0,1], 0.5f, DRAWFLAG_ADDITIVE);
}
drawstring(pos, getplayerkeyvalue(i, "name"), [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
drawstring(pos + [154,0], "/", [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
/* Get the kills and align them left to right */
kills = getplayerkeyvalue(i, "frags");
l = stringwidth(kills, FALSE, [8,8]);
drawstring(pos + [150 - l,0], kills, [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
/* Deaths are right to left aligned */
deaths = getplayerkeyvalue(i, "*deaths");
drawstring(pos + [165,0], deaths, [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
/* Get the latency and align it left to right */
ping = getplayerkeyvalue(i, "ping");
l = stringwidth(ping, FALSE, [8,8]);
drawstring(pos + [290 - l,0], ping, [8,8], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE);
pos[1] += 20;
}
drawfont = Font_GetID(FONT_CON);
}
void
Scores_Draw(void)
{
vector pos;
ncPlayer pl;
pl = (ncPlayer)pSeat->m_ePlayer;
if (autocvar_cl_centerscores) {
int c = 10;
/* calculate all valid entries */
for (int i = -1; i > -32; i--) {
if (getplayerkeyvalue(i, "name")) {
break;
}
c += 10;
}
pos = video_mins + [(g_vidsize[0] / 2) - 145, (g_vidsize[1] / 2) - c];
} else {
pos = video_mins + [(g_vidsize[0] / 2) - 145, 30];
}
if (Util_IsTeamplay()) {
Scores_DrawTeam(pl, pos);
} else {
Scores_DrawNormal(pl, pos);
}
}
#define BOB_STRENGTH 0.02
#define BOB_CYCLE 1.0
#define BOB_UP 0.60
var vector autocvar_bg_bobAmplitudeDucked = [0.0075, 0.0065, 0.0000];
var vector autocvar_bg_bobAmplitudeProne = [0.02, 0.005, 0.0000];
var vector autocvar_bg_bobAmplitudeSprinting = [0.02, 0.014, 0.0000];
var vector autocvar_bg_bobAmplitudeStanding = [0.007, 0.007, 0.0000];
var float autocvar_bg_bobMax = 8.0;
var float autocvar_player_sprintCameraBob = 0.5;
struct
{
float m_flBobTime;
float m_flBobTime2;
float m_flBob;
float m_flBob2;
float m_flBobCycle;
float m_flBobCycle2;
float m_flSpeed;
float m_flViewBob;
float m_flViewBob2;
} g_viewBobVars[4], *pViewBob;
/* bob vars are calculated separately from application, so that if there's
* more than one viewmodel we won't affect the speed of the bob by running
* the math too many times */
void
Viewmodel_CalcBob(void)
{
int s = (float)getproperty(VF_ACTIVESEAT);
pViewBob = &g_viewBobVars[s];
vector vecVel;
float flBob;
float var_bob;
float var_cycle;
float var_up;
bool isSprinting = pSeat->m_ePlayer.vv_flags & VFL_SPRINTING;
bool isCrouching = pSeat->m_ePlayer.vv_flags & VFL_CROUCHING;
// if (pSeatLocal->m_iSprinting && vlen(pSeat->m_vecPredictedVelocity) > 240)
// isSprinting = true;
var_bob = BOB_STRENGTH;
var_cycle = BOB_CYCLE;
var_up = BOB_UP;
if (isSprinting)
var_cycle *= autocvar_player_sprintCameraBob;
pViewBob->m_flBobTime += frametime;
pViewBob->m_flBobCycle = pViewBob->m_flBobTime - (int)(pViewBob->m_flBobTime / var_cycle) * var_cycle;
pViewBob->m_flBobCycle /= var_cycle;
if (pViewBob->m_flBobCycle < var_up) {
pViewBob->m_flBobCycle = MATH_PI * pViewBob->m_flBobCycle / var_up;
} else {
pViewBob->m_flBobCycle = MATH_PI + MATH_PI * (pViewBob->m_flBobCycle - var_up)/(1.0 - var_up);
}
vecVel = pSeat->m_vecPredictedVelocity;
vecVel[2] = 0;
pViewBob->m_flSpeed = vlen(vecVel);
flBob = pViewBob->m_flSpeed * var_bob;
flBob = flBob * sin(pViewBob->m_flBobCycle);
pViewBob->m_flBob = flBob;
/* BOB2, which is half the cycle of bob1 */
pViewBob->m_flBobTime2 += frametime;
pViewBob->m_flBobCycle2 = pViewBob->m_flBobTime2 - (int)(pViewBob->m_flBobTime2 / (var_cycle * 0.5f)) * (var_cycle * 0.5f);
pViewBob->m_flBobCycle2 /= (var_cycle * 0.5f);
if (pViewBob->m_flBobCycle2 < var_up) {
pViewBob->m_flBobCycle2 = MATH_PI * pViewBob->m_flBobCycle2 / var_up;
} else {
pViewBob->m_flBobCycle2 = MATH_PI + MATH_PI * (pViewBob->m_flBobCycle2 - var_up)/(1.0 - var_up);
}
flBob = pViewBob->m_flSpeed * (var_bob * 0.5);
flBob = flBob * cos(pViewBob->m_flBobCycle2);
pViewBob->m_flBob2 = flBob;
if (isSprinting) {
pViewBob->m_flViewBob2 = pViewBob->m_flBob2 * autocvar_bg_bobAmplitudeSprinting[0] * 25.0f;
pViewBob->m_flViewBob = pViewBob->m_flBob * autocvar_bg_bobAmplitudeSprinting[1] * 25.0f;
pViewBob->m_flBob2 *= autocvar_bg_bobAmplitudeSprinting[0] * 20.0;
pViewBob->m_flBob *= autocvar_bg_bobAmplitudeSprinting[1] * 20.0;
} else if (isCrouching) {
pViewBob->m_flViewBob2 = pViewBob->m_flBob2 * autocvar_bg_bobAmplitudeDucked[0] * 25.0f;
pViewBob->m_flViewBob = pViewBob->m_flBob * autocvar_bg_bobAmplitudeDucked[1] * 25.0f;
pViewBob->m_flBob2 *= autocvar_bg_bobAmplitudeDucked[0] * 20.0;
pViewBob->m_flBob *= autocvar_bg_bobAmplitudeDucked[1] * 20.0;
} else {
pViewBob->m_flViewBob2 = pViewBob->m_flBob2 * autocvar_bg_bobAmplitudeStanding[0] * 25.0f;
pViewBob->m_flViewBob = pViewBob->m_flBob * autocvar_bg_bobAmplitudeStanding[1] * 25.0f;
pViewBob->m_flBob2 *= autocvar_bg_bobAmplitudeStanding[0] * 20.0;
pViewBob->m_flBob *= autocvar_bg_bobAmplitudeStanding[1] * 20.0;
}
}
void
Viewmodel_ApplyBob(entity gun)
{
int s = (float)getproperty(VF_ACTIVESEAT);
pViewBob = &g_viewBobVars[s];
float sintime;
float strength;
float kickUp;
//gun.angles[2] = pViewBob->m_flBob2 * -2.0f;
gun.angles[2] = pViewBob->m_flViewBob * 4.0f;
kickUp = pViewBob->m_flViewBob2 * 4.0f;
vector angmod = [0,0,0];
angmod[0] = pViewBob->m_flViewBob2 + kickUp;
angmod[1] = pViewBob->m_flViewBob;
//angmod[2] += pViewBob->m_flBob * 3.0f;
gun.angles += angmod;
/* sway with speed */
sintime = sin(time);
strength = pViewBob->m_flSpeed;
if (strength > 240)
strength = 240;
strength = 240 - strength;
strength *= 0.01f;
float sprint;
if (pSeat->m_ePlayer.vv_flags & VFL_SPRINTING) {
pSeat->m_flSprintLerp = bound(0.0f, pSeat->m_flSprintLerp + clframetime, 1.0f);
} else {
pSeat->m_flSprintLerp = bound(0.0f, pSeat->m_flSprintLerp - clframetime, 1.0f);
}
sprint = 20 * pSeat->m_flSprintLerp;
gun.angles[0] += sprint;
gun.angles[1] += sprint + (sprint * pViewBob->m_flBob) * 0.25f;
#ifdef WASTES
if (pSeat->m_ePlayer.gflags & GF_IS_HEALING) {
pSeatLocal->m_flHealLerp = bound(0.0f, pSeatLocal->m_flHealLerp + clframetime, 1.0f);
} else {
pSeatLocal->m_flHealLerp = bound(0.0f, pSeatLocal->m_flHealLerp - clframetime, 1.0f);
}
gun.angles[0] += pSeatLocal->m_flHealLerp * 45;
gun.origin[2] -= pSeatLocal->m_flHealLerp * 5;
#endif
gun.angles[0] += strength * sintime;
gun.angles[1] += strength * sintime;
//gun.angles[2] += strength * sintime;
gun.origin += [0,0,-1];
makevectors(g_view.GetCameraAngle());
gun.origin += v_forward * cvar("cl_gunx");
gun.origin += v_right * cvar("cl_guny");
gun.origin += v_up * cvar("cl_gunz");
/* lower gun when moving */
if (pViewBob->m_flSpeed > 10.0) {
gun.origin += (v_up * -pViewBob->m_flSpeed * 0.005f);
gun.origin += (v_right * -pViewBob->m_flSpeed * 0.005f);
}
}
vector
Camera_AddCamBob(vector cameraAngle)
{
vector angmod = g_vec_null;
makevectors(cameraAngle);
angmod = (pViewBob->m_flBob2 * -v_up);
angmod += (pViewBob->m_flBob * -v_right);
return angmod;
}

95
src/client/progdefs.h Normal file
View file

@ -0,0 +1,95 @@
/* File generated by FTEQCC, relevent for engine modding only, the generated crc must be the same as your engine expects. */
typedef struct globalvars_s
{
int ofs_null;
int ofs_return[3];
int ofs_parm0[3];
int ofs_parm1[3];
int ofs_parm2[3];
int ofs_parm3[3];
int ofs_parm4[3];
int ofs_parm5[3];
int ofs_parm6[3];
int ofs_parm7[3];
int self;
int other;
int world;
float time;
float cltime;
float frametime;
float player_localentnum;
float player_localnum;
float maxclients;
float clientcommandframe;
float servercommandframe;
string_t mapname;
float intermission;
vec3_t v_forward;
vec3_t v_up;
vec3_t v_right;
vec3_t view_angles;
float trace_allsolid;
float trace_startsolid;
float trace_fraction;
vec3_t trace_endpos;
vec3_t trace_plane_normal;
float trace_plane_dist;
int trace_ent;
float trace_inopen;
float trace_inwater;
float input_timelength;
vec3_t input_angles;
vec3_t input_movevalues;
float input_buttons;
float input_impulse;
} globalvars_t;
typedef struct entvars_s
{
float modelindex;
vec3_t absmin;
vec3_t absmax;
float entnum;
float drawmask;
func_t predraw;
func_t ncDecal::__mpredraw;
func_t ncEntity::__mpredraw;
func_t func_dustcloud_cloud::__mpredraw;
func_t func_smokevolume_cloud::__mpredraw;
func_t env_steam_particle::__mpredraw;
float movetype;
float solid;
vec3_t origin;
vec3_t oldorigin;
vec3_t velocity;
vec3_t angles;
vec3_t avelocity;
float pmove_flags;
string_t classname;
float renderflags;
string_t model;
float frame;
float frame1time;
float frame2;
float frame2time;
float lerpfrac;
float skin;
float effects;
vec3_t mins;
vec3_t maxs;
vec3_t size;
func_t touch;
func_t think;
func_t env_sprite::__mthink;
func_t blocked;
float nextthink;
int chain;
int enemy;
float flags;
float colormap;
int owner;
} entvars_t;
#define PROGHEADER_CRC 42444

32
src/client/progs.src Normal file
View file

@ -0,0 +1,32 @@
#pragma target fte_5768
#pragma progs_dat "../../csprogs.dat"
//#pragma flag enable assumeint
#pragma forcecrc 54730
#define CSQC
#define CLIENT
#includelist
/* first the engine, then nuclide headers for client/shared */
../../../src/shared/fteextensions.qc
../../../src/shared/defs.h
../../../src/client/defs.h
/* mod specific header */
defs.h
/* for VGUI elements, we want to include this (optional) */
../../../src/vgui/include.src
/* include the entity codebase */
../../../src/gs-entbase/client.src
../../../src/gs-entbase/shared.src
/* mod specific functions */
../shared/include.src
main.qc
/* global client/shared code */
../../../src/client/include.src
../../../src/shared/include.src
#endlist

113
src/files.dat Normal file
View file

@ -0,0 +1,113 @@
112
1 csprogs.dat
1 decls/def/ammo.def
1 decls/def/ammo/base.def
1 decls/def/ammo/bullets.def
1 decls/def/ammo/cells.def
1 decls/def/ammo/grenades.def
1 decls/def/ammo/rockets.def
1 decls/def/ammo/shells.def
1 decls/def/ammo/slugs.def
1 decls/def/items.def
1 decls/def/items/adrenaline.def
1 decls/def/items/ancient_head.def
1 decls/def/items/armor_body.def
1 decls/def/items/armor_combat.def
1 decls/def/items/armor_jacket.def
1 decls/def/items/armor_shard.def
1 decls/def/items/bandolier.def
1 decls/def/items/base.def
1 decls/def/items/breather.def
1 decls/def/items/envirosuit.def
1 decls/def/items/health.def
1 decls/def/items/health_large.def
1 decls/def/items/health_mega.def
1 decls/def/items/health_small.def
1 decls/def/items/invulnerability.def
1 decls/def/items/pack.def
1 decls/def/items/quad.def
1 decls/def/monsters.def
1 decls/def/monsters/soldier.def
1 decls/def/player.def
1 decls/def/projectiles.def
1 decls/def/spawns.def
1 decls/def/weapons.def
1 decls/def/weapons/base.def
1 decls/def/weapons/bfg.def
1 decls/def/weapons/blaster.def
1 decls/def/weapons/chaingun.def
1 decls/def/weapons/grenadelauncher.def
1 decls/def/weapons/handgrenade.def
1 decls/def/weapons/hyperblaster.def
1 decls/def/weapons/machinegun.def
1 decls/def/weapons/railgun.def
1 decls/def/weapons/rocketlauncher.def
1 decls/def/weapons/shotgun.def
1 decls/def/weapons/supershotgun.def
1 decls/sound/footsteps.sndshd
1 decls/sound/impacts.sndshd
1 decls/sound/items_baseq2.sndshd
1 decls/sound/player.sndshd
1 decls/sound/weapons.sndshd
1 default_baseq2.cfg
1 default_controls.cfg
1 default_cvar.cfg
1 default_video.cfg
1 fonts/chat.font
1 fonts/font16.font
1 fonts/font20.font
1 fonts/fontcon.font
1 fonts/ui.font
1 gfx/background.mat
1 liblist.gam
1 menu.dat
1 models/monsters/soldier/tris.md2.framegroups
1 models/weapons/v_bfg/tris.md2.framegroups
1 models/weapons/v_blast/tris.md2.framegroups
1 models/weapons/v_chain/tris.md2.framegroups
1 models/weapons/v_handgr/tris.md2.framegroups
1 models/weapons/v_hyperb/tris.md2.framegroups
1 models/weapons/v_launch/tris.md2.framegroups
1 models/weapons/v_machn/tris.md2.framegroups
1 models/weapons/v_rail/tris.md2.framegroups
1 models/weapons/v_rocket/tris.md2.framegroups
1 models/weapons/v_shotg/tris.md2.framegroups
1 models/weapons/v_shotg2/tris.md2.framegroups
1 progs.dat
1 progs/deathmatch.dat
1 progs/singleplayer.dat
1 quake.rc
1 scripts/bots.txt
1 scripts/constants.txt
1 scripts/hud.shader
1 scripts/map_blacklist
1 scripts/propdata.txt
1 scripts/surfaceproperties.txt
1 scripts/surfaceproperties_manifest.txt
1 scripts/ui_style.txt
1 textures/sfx/alpha.tga
1 textures/sfx/cone.tga
1 textures/sfx/dustcloud.mat
1 textures/sfx/dustcloud.tga
1 textures/sfx/flare1.tga
1 textures/sfx/flare2.tga
1 textures/sfx/flare3.tga
1 textures/sfx/flare4.tga
1 textures/sfx/fog.tga
1 textures/sfx/fog_test.mat
1 textures/sfx/heatsteam.mat
1 textures/sfx/liquidtube.mat
1 textures/sfx/mirror.mat
1 textures/sfx/mirror.tga
1 textures/sfx/mirror_n.tga
1 textures/sfx/normwobble.tga
1 textures/sfx/reflection.mat
1 textures/sfx/reflection.tga
1 textures/sfx/smoke.mat
1 textures/sfx/smoke.tga
1 textures/sfx/smokevolume.mat
1 textures/sfx/spot_cone.mat
1 textures/sfx/spot_flare.mat
1 textures/sfx/spot_flare.tga
1 textures/sfx/steam.mat
1 textures/sfx/steam.tga

4
src/maps/Makefile Normal file
View file

@ -0,0 +1,4 @@
QCC=fteqcc
all:
$(QCC) demo.qc

11
src/maps/demo.qc Normal file
View file

@ -0,0 +1,11 @@
#pragma PROGS_DAT "../../maps/demo.dat"
#include "../../../src/server/api.h"
void
CSEv_TriggerTarget_s(string toTrigger)
{
for (entity e = world; (e = find(e, ::targetname, "laser1"));) {
ents.Input(e, "Trigger", "", e);
}
}

4
src/menu/Makefile Normal file
View file

@ -0,0 +1,4 @@
QCC=fteqcc
all:
$(QCC) progs.src

Some files were not shown because too many files have changed in this diff Show more