X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fview.qc;h=d3c1314cd671fdea4bcfa936e26dc9487f0e9b8a;hp=e4f38b24c2d145e917765d4ee725f171feff083b;hb=723fe3aa08556fdde679753c0afde734853f34e5;hpb=fdbfb6f9364d8aeae67e108400a6bd1dd37dc0b7 diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index e4f38b24c2..d3c1314cd6 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -12,6 +12,7 @@ #include "mutators/events.qh" #include +#include #include #include #include @@ -29,6 +30,7 @@ #include #include +#include #include #include #include @@ -470,7 +472,7 @@ vector GetCurrentFov(float fov) { entity wepent = viewmodels[slot]; if(wepent.switchweapon == wepent.activeweapon) - if((wepent.activeweapon == WEP_VORTEX && !WEP_CVAR(vortex, secondary)) || (wepent.activeweapon == WEP_RIFLE && !WEP_CVAR(rifle, secondary))) // do NOT use switchweapon here + if((wepent.activeweapon == WEP_VORTEX && !WEP_CVAR(vortex, secondary)) || (wepent.activeweapon == WEP_RIFLE && !WEP_CVAR(rifle, secondary)) || (wepent.activeweapon == WEP_OVERKILL_VORTEX && !WEP_CVAR(okvortex, secondary))) // do NOT use switchweapon here zoomdir += button_attack2; } } @@ -662,6 +664,7 @@ float TrueAimCheck(entity wepent) case WEP_MORTAR: // toss curve return SHOTTYPE_HITWORLD; case WEP_VORTEX: + case WEP_OVERKILL_VORTEX: case WEP_VAPORIZER: mv = MOVE_NORMAL; break; @@ -910,7 +913,8 @@ vector crosshair_getcolor(entity this, float health_stat) case 2: // crosshair_color_by_health { - float hp = health_stat; + vector v = healtharmor_maxdamage(health_stat, STAT(ARMOR), armorblockpercent, DEATH_WEAPON.m_id); + float hp = floor(v.x + 1); //x = red //y = green @@ -1186,6 +1190,10 @@ void HUD_Crosshair(entity this) vortex_charge = STAT(VORTEX_CHARGE); vortex_chargepool = STAT(VORTEX_CHARGEPOOL); + float okvortex_charge, okvortex_chargepool; + okvortex_charge = STAT(OVERKILL_VORTEX_CHARGE); + okvortex_chargepool = STAT(OVERKILL_VORTEX_CHARGEPOOL); + float arc_heat = STAT(ARC_HEAT); if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game @@ -1214,6 +1222,26 @@ void HUD_Crosshair(entity this) ring_rgb = wcross_color; ring_image = "gfx/crosshair_ring_nexgun.tga"; } + else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_VORTEX) && okvortex_charge && autocvar_crosshair_ring_vortex) + { + if (okvortex_chargepool || use_vortex_chargepool) { + use_vortex_chargepool = 1; + ring_inner_value = okvortex_chargepool; + } else { + vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * okvortex_charge; + ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (okvortex_charge - vortex_charge_movingavg), 1); + } + + ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha; + ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue; + ring_inner_image = "gfx/crosshair_ring_inner.tga"; + + // draw the outer ring to show the current charge of the weapon + ring_value = okvortex_charge; + ring_alpha = autocvar_crosshair_ring_vortex_alpha; + ring_rgb = wcross_color; + ring_image = "gfx/crosshair_ring_nexgun.tga"; + } else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer) { ring_value = bound(0, STAT(LAYED_MINES) / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. @@ -1782,7 +1810,7 @@ void CSQC_UpdateView(entity this, float w, float h) ov_enabled = true; #if 0 - LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n", + LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f", vtos(ov_org), vtos(getpropertyvec(VF_ANGLES)), ov_distance,