From: bones_was_here Date: Sat, 4 Jun 2022 12:43:50 +0000 (+0000) Subject: Merge branch 'Mario/monsters' into 'develop' X-Git-Tag: xonotic-v0.8.5~7^2~1 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=561489d21c9053b7103c6604c362aa24ee5c7916;hp=-c;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'Mario/monsters' into 'develop' Merge branch Mario/monsters (L merge request) See merge request xonotic/xonotic-data.pk3dir!1017 --- 561489d21c9053b7103c6604c362aa24ee5c7916 diff --combined gamemodes-server.cfg index 483b6ea3f,bdac1a234..318749021 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@@ -322,7 -322,7 +322,7 @@@ exec ctfscoring-samual.cf // ==================== set g_cts 0 "CTS: complete the stage" set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts" -set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible" +set g_cts_finish_kill_delay 2 "kill player this many seconds after stage completion to prevent cheating by starting out with more speed than otherwise possible; set it to 0 to not kill or to -1 to kill instantly" set g_cts_send_rankings_cnt 15 "send this number of map records to clients" set g_cts_removeprojectiles 0 "remove projectiles when the player dies, to prevent using weapons earlier in the stage than intended" @@@ -551,8 -551,6 +551,6 @@@ set g_invasion_monster_count 10 "numbe set g_invasion_zombies_only 0 "only spawn zombies" set g_invasion_spawn_delay 0.25 set g_invasion_spawnpoint_spawn_delay 0.5 - set g_invasion_teams 0 "number of teams in invasion (note: use mapinfo to set this)" - set g_invasion_team_spawns 1 "use team spawns in teamplay invasion mode" set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: complete the stage (note: use mapinfo to set this)" // ====== diff --combined qcsrc/client/csqcmodel_hooks.qc index f1f581a83,06cf44bdb..121af1947 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@@ -23,8 -23,10 +23,10 @@@ .int lodmodelindex0; .int lodmodelindex1; .int lodmodelindex2; - void CSQCPlayer_LOD_Apply(entity this) + void CSQCPlayer_LOD_Apply(entity this, bool isplayer) { + int detailreduction = ((isplayer) ? autocvar_cl_playerdetailreduction : autocvar_cl_modeldetailreduction); + // LOD model loading if(this.lodmodelindex0 != this.modelindex) { @@@ -63,19 -65,19 +65,19 @@@ } // apply LOD - if(autocvar_cl_playerdetailreduction <= 0) + if(detailreduction <= 0) { - if(autocvar_cl_playerdetailreduction <= -2) + if(detailreduction <= -2) this.modelindex = this.lodmodelindex2; - else if(autocvar_cl_playerdetailreduction <= -1) + else if(detailreduction <= -1) this.modelindex = this.lodmodelindex1; else this.modelindex = this.lodmodelindex0; } else { - float distance = vlen(this.origin - view_origin); - float f = (distance * current_viewzoom + 100.0) * autocvar_cl_playerdetailreduction; + float distance = vlen(((isplayer) ? this.origin : NearestPointOnBox(this, view_origin)) - view_origin); // TODO: perhaps it should just use NearestPointOnBox all the time, player hitbox can potentially be huge + float f = (distance * current_viewzoom + 100.0) * detailreduction; f *= 1.0 / bound(0.01, view_quality, 1); if(f > autocvar_cl_loddistance2) this.modelindex = this.lodmodelindex2; @@@ -328,7 -330,7 +330,7 @@@ void CSQCPlayer_ModelAppearance_Apply(e // GLOWMOD AND DEATH FADING if(this.colormap > 0) - this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true) * 2; + this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true); else this.glowmod = '1 1 1'; @@@ -346,10 -348,6 +348,10 @@@ } } + // don't let the engine increase player's glowmod + if (autocvar_r_hdr_glowintensity > 1) + this.glowmod /= autocvar_r_hdr_glowintensity; + //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod)); } @@@ -667,7 -665,7 +669,7 @@@ void CSQCModel_Hook_PreDraw(entity this if((this.isplayermodel & ISPLAYER_MODEL) && this.drawmask) // this checks if it's a player MODEL! { CSQCPlayer_ModelAppearance_Apply(this, (this.isplayermodel & ISPLAYER_LOCAL)); - CSQCPlayer_LOD_Apply(this); + CSQCPlayer_LOD_Apply(this, true); if(!isplayer) { @@@ -745,6 -743,8 +747,8 @@@ } } } + else + CSQCPlayer_LOD_Apply(this, false); CSQCModel_AutoTagIndex_Apply(this); diff --combined qcsrc/client/weapons/projectile.qc index 3cfd741a4,b4c9f86b2..1df65036e --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@@ -276,7 -276,7 +276,7 @@@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool // TODO: projectiles use glowmaps for their color, not teams #if 0 if(this.colormap > 0) - this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true) * 2; + this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true); else this.glowmod = '1 1 1'; #endif @@@ -317,7 -317,7 +317,7 @@@ HANDLE(SEEKER) this.traileffect = EFFECT_SEEKER_TRAIL.m_id; break; HANDLE(MAGE_SPIKE) this.traileffect = EFFECT_TR_VORESPIKE.m_id; break; - HANDLE(SHAMBLER_LIGHTNING) this.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break; + HANDLE(GOLEM_LIGHTNING) this.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break; HANDLE(RAPTORBOMB) this.gravity = 1; this.avelocity = '0 0 180'; this.traileffect = EFFECT_Null.m_id; break; HANDLE(RAPTORBOMBLET) this.gravity = 1; this.avelocity = '0 0 180'; this.traileffect = EFFECT_Null.m_id; break; @@@ -379,7 -379,7 +379,7 @@@ this.bouncefactor = WEP_CVAR(mortar, bouncefactor); this.bouncestop = WEP_CVAR(mortar, bouncestop); break; - case PROJECTILE_SHAMBLER_LIGHTNING: + case PROJECTILE_GOLEM_LIGHTNING: this.mins = '-8 -8 -8'; this.maxs = '8 8 8'; this.scale = 2.5; diff --combined qcsrc/server/world.qc index 6c2e4a3f7,7e1333eb8..551952172 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@@ -35,6 -35,7 +35,6 @@@ #include #include #include -#include #include #include #include @@@ -45,6 -46,7 +45,6 @@@ #include #include #include -#include #include const float LATENCY_THINKRATE = 10; @@@ -277,7 -279,6 +277,6 @@@ void cvar_changes_init( BADCVAR("g_duel_not_dm_maps"); BADCVAR("g_freezetag"); BADCVAR("g_freezetag_teams"); - BADCVAR("g_invasion_teams"); BADCVAR("g_invasion_type"); BADCVAR("g_jailbreak"); BADCVAR("g_jailbreak_teams"); @@@ -842,15 -843,46 +841,15 @@@ spawnfunc(worldspawn WaypointSprite_Init(); - GameLogInit(); // prepare everything // NOTE for matchid: // changing the logic generating it is okay. But: // it HAS to stay <= 64 chars // character set: ASCII 33-126 without the following characters: : ; ' " \ $ - if(autocvar_sv_eventlog) - { - string num = strftime_s(); // strftime(false, "%s") isn't reliable, see strftime_s description - string s = sprintf("%s.%s.%06d", itos(autocvar_sv_eventlog_files_counter), num, floor(random() * 1000000)); - matchid = strzone(s); - - GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s)); - s = ":gameinfo:mutators:LIST"; - - MUTATOR_CALLHOOK(BuildMutatorsString, s); - s = M_ARGV(0, string); - - // initialiation stuff, not good in the mutator system - if(!autocvar_g_use_ammunition) - s = strcat(s, ":no_use_ammunition"); - - // initialiation stuff, not good in the mutator system - if(autocvar_g_pickup_items == 0) - s = strcat(s, ":no_pickup_items"); - if(autocvar_g_pickup_items > 0) - s = strcat(s, ":pickup_items"); + // strftime(false, "%s") isn't reliable, see strftime_s description + matchid = strzone(sprintf("%d.%s.%06d", autocvar_sv_eventlog_files_counter, strftime_s(), random() * 1000000)); - // initialiation stuff, not good in the mutator system - if(autocvar_g_weaponarena != "0") - s = strcat(s, ":", autocvar_g_weaponarena, " arena"); - - // TODO to mutator system - if(autocvar_g_norecoil) - s = strcat(s, ":norecoil"); - - GameLogEcho(s); - GameLogEcho(":gameinfo:end"); - } - else - matchid = strzone(ftos(random())); + if(autocvar_sv_eventlog) + GameLogInit(); // requires matchid to be set cvar_set("nextmap", ""); @@@ -1000,7 -1032,7 +999,7 @@@ spawnfunc(light delete(this); } - bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance) + bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos) { float m = e.dphitcontentsmask; e.dphitcontentsmask = goodcontents | badcontents; @@@ -1057,15 -1089,23 +1056,23 @@@ continue; // rule 4: we must "see" some spawnpoint or item - entity sp = NULL; - IL_EACH(g_spawnpoints, checkpvs(mstart, it), - { - if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1) - { - sp = it; - break; - } - }); + entity sp = NULL; + if(frompos) + { + if((traceline(mstart, e.origin, MOVE_NORMAL, e), trace_fraction) >= 1) + sp = e; + } + if(!sp) + { + IL_EACH(g_spawnpoints, checkpvs(mstart, it), + { + if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1) + { + sp = it; + break; + } + }); + } if(!sp) { int items_checked = 0; @@@ -1124,7 -1164,7 +1131,7 @@@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance) { - return MoveToRandomLocationWithinBounds(e, world.mins, world.maxs, goodcontents, badcontents, badsurfaceflags, attempts, maxaboveground, minviewdistance); + return MoveToRandomLocationWithinBounds(e, world.mins, world.maxs, goodcontents, badcontents, badsurfaceflags, attempts, maxaboveground, minviewdistance, false); } /* diff --combined xonotic-client.cfg index f3c5ca773,5fc057887..7a0dec689 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@@ -386,6 -386,8 +386,6 @@@ alias weapon_group_7 "impulse 7 alias weapon_group_8 "impulse 8" alias weapon_group_9 "impulse 9" alias weapon_group_0 "impulse 14" // cycles the superweapons -// TODO: remove after 0.8.2. Default impulse commands for 0.8.1 servers -exec weapons.cfg cl_curl_enabled 1 cl_curl_maxdownloads 3 @@@ -728,7 -730,7 +728,7 @@@ set menu_updatecheck_getpacks 1 "get up seta cl_loddistance1 1024 seta cl_loddistance2 3072 seta cl_playerdetailreduction 4 "the higher, the less detailed player models are displayed (LOD)" - seta cl_modeldetailreduction 1 "the higher, the less detailed certain map models are displayed (LOD)" + seta cl_modeldetailreduction 1 "higher values will reduce the detail of non-player and non-weapon models (LOD)" seta cl_casings_maxcount 100 "maximum amount of shell casings (must be at least 1)" seta cl_gibs_maxcount 100 "maximum amount of gibs (must be at least 1)"