mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- Added Karate Chris's teamdamage in MAPINFO submission.
- Added Blzut3's second SBARINFO update. SVN r621 (trunk)
This commit is contained in:
parent
aacb694200
commit
4131ec141d
7 changed files with 47 additions and 14 deletions
|
@ -1,4 +1,7 @@
|
|||
December 22, 2007 (Changes by Graf Zahl)
|
||||
- Added Karate Chris's teamdamage in MAPINFO submission.
|
||||
- Added Blzut3's second SBARINFO update.
|
||||
- Fixed: The second flash state of the chaingun called A_Light1 instead of A_Light2.
|
||||
- Added Blzut3's SBARINFO update.
|
||||
|
||||
December 21, 2007
|
||||
|
|
|
@ -51,7 +51,11 @@ CVAR (Bool, var_friction, true, CVAR_SERVERINFO);
|
|||
CVAR (Bool, var_pushers, true, CVAR_SERVERINFO);
|
||||
|
||||
CVAR (Bool, alwaysapplydmflags, false, CVAR_SERVERINFO);
|
||||
CVAR (Float, teamdamage, 0.f, CVAR_SERVERINFO);
|
||||
|
||||
CUSTOM_CVAR (Float, teamdamage, 0.f, CVAR_SERVERINFO)
|
||||
{
|
||||
level.teamdamage = self;
|
||||
}
|
||||
|
||||
CUSTOM_CVAR (String, language, "auto", CVAR_ARCHIVE)
|
||||
{
|
||||
|
|
|
@ -438,7 +438,7 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage)
|
|||
}
|
||||
else
|
||||
{
|
||||
dopoison = victim->player->poisoncount < (int)(4.f * teamdamage);
|
||||
dopoison = victim->player->poisoncount < (int)(4.f * level.teamdamage);
|
||||
}
|
||||
|
||||
if (dopoison)
|
||||
|
@ -446,7 +446,7 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage)
|
|||
int damage = 15 + (pr_poisoncloudd()&15);
|
||||
if (mate)
|
||||
{
|
||||
damage = (int)((float)damage * teamdamage);
|
||||
damage = (int)((float)damage * level.teamdamage);
|
||||
}
|
||||
if (damage > 0)
|
||||
{
|
||||
|
|
|
@ -299,6 +299,7 @@ static const char *MapInfoMapLevel[] =
|
|||
"infiniteflightpowerup",
|
||||
"noinfiniteflightpowerup",
|
||||
"allowrespawn",
|
||||
"teamdamage",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -440,6 +441,7 @@ MapHandlers[] =
|
|||
{ MITYPE_SETFLAG, LEVEL_INFINITE_FLIGHT, 0 },
|
||||
{ MITYPE_CLRFLAG, LEVEL_INFINITE_FLIGHT, 0 },
|
||||
{ MITYPE_SETFLAG, LEVEL_ALLOWRESPAWN, 0 },
|
||||
{ MITYPE_FLOAT, lioffset(teamdamage), 0 },
|
||||
};
|
||||
|
||||
static const char *MapInfoClusterLevel[] =
|
||||
|
@ -2259,6 +2261,7 @@ void G_InitLevelLocals ()
|
|||
|
||||
level.gravity = sv_gravity * 35/TICRATE;
|
||||
level.aircontrol = (fixed_t)(sv_aircontrol * 65536.f);
|
||||
level.teamdamage = teamdamage;
|
||||
level.flags = 0;
|
||||
|
||||
info = FindLevelInfo (level.mapname);
|
||||
|
@ -2297,6 +2300,10 @@ void G_InitLevelLocals ()
|
|||
{
|
||||
level.aircontrol = (fixed_t)(info->aircontrol * 65536.f);
|
||||
}
|
||||
if (info->teamdamage != 0.f)
|
||||
{
|
||||
level.teamdamage = info->teamdamage;
|
||||
}
|
||||
|
||||
G_AirControlChanged ();
|
||||
|
||||
|
@ -2621,6 +2628,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
|
|||
<< level.killed_monsters
|
||||
<< level.gravity
|
||||
<< level.aircontrol
|
||||
<< level.teamdamage
|
||||
<< level.maptime
|
||||
<< i;
|
||||
|
||||
|
|
|
@ -175,6 +175,8 @@ struct level_info_s
|
|||
char sndseq[9];
|
||||
char bordertexture[9];
|
||||
FSpecialAction * specialactions;
|
||||
|
||||
float teamdamage;
|
||||
};
|
||||
typedef struct level_info_s level_info_t;
|
||||
|
||||
|
@ -242,6 +244,8 @@ struct level_locals_s
|
|||
|
||||
const char *f1;
|
||||
|
||||
float teamdamage;
|
||||
|
||||
bool IsJumpingAllowed() const;
|
||||
bool IsCrouchingAllowed() const;
|
||||
bool IsFreelookAllowed() const;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "i_system.h"
|
||||
#include "sbarinfo.h"
|
||||
#include "sc_man.h"
|
||||
#include "gi.h"
|
||||
|
||||
static FRandom pr_chainwiggle; //use the same method of chain wiggling as heretic.
|
||||
|
||||
|
@ -651,11 +652,21 @@ void SBarInfo::ParseSBarInfoBlock(SBarInfoBlock &block)
|
|||
cmd.sprite = newImage(sc_String);
|
||||
SC_MustGetToken(',');
|
||||
SC_MustGetToken(TK_IntConst);
|
||||
if(sc_Number <= 0)
|
||||
SC_ScriptError("Size must be a positive number.");
|
||||
if(sc_Number < 0)
|
||||
SC_ScriptError("Left padding must be a positive number.");
|
||||
cmd.special2 = sc_Number;
|
||||
SC_MustGetToken(',');
|
||||
SC_MustGetToken(TK_IntConst);
|
||||
if(sc_Number < 0)
|
||||
SC_ScriptError("Right padding must be a positive number.");
|
||||
cmd.special3 = sc_Number;
|
||||
SC_MustGetToken(',');
|
||||
SC_MustGetToken(TK_IntConst);
|
||||
if(sc_Number < 0)
|
||||
SC_ScriptError("Chain size must be a positive number.");
|
||||
cmd.special4 = sc_Number;
|
||||
SC_MustGetToken(',');
|
||||
SC_MustGetToken(TK_IntConst);
|
||||
cmd.x = sc_Number;
|
||||
SC_MustGetToken(',');
|
||||
SC_MustGetToken(TK_IntConst);
|
||||
|
@ -1467,7 +1478,7 @@ private:
|
|||
{
|
||||
wiggle = (cmd.flags & DRAWGEM_WIGGLE) == DRAWGEM_WIGGLE;
|
||||
}
|
||||
DrawGem(Images[cmd.special], Images[cmd.sprite], value, cmd.x, cmd.y, cmd.special2, wiggle, translate);
|
||||
DrawGem(Images[cmd.special], Images[cmd.sprite], value, cmd.x, cmd.y, cmd.special2, cmd.special3, cmd.special4-1, wiggle, translate);
|
||||
break;
|
||||
}
|
||||
case SBARINFO_GAMEMODE:
|
||||
|
@ -1499,7 +1510,7 @@ private:
|
|||
y -= (texture->GetHeight()/2)-texture->TopOffset;
|
||||
}
|
||||
if((flags & DRAWIMAGE_TRANSLATABLE) == DRAWIMAGE_TRANSLATABLE)
|
||||
DrawImage(texture, x, y, translationtables[TRANSLATION_Players] + (CPlayer - players)*256);
|
||||
DrawImage(texture, x, y, getTranslation());
|
||||
else
|
||||
DrawImage(texture, x, y);
|
||||
}
|
||||
|
@ -1710,7 +1721,8 @@ private:
|
|||
}
|
||||
|
||||
//draws heretic/hexen style life gems
|
||||
void DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int size, bool wiggle, bool translate)
|
||||
void DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int padleft, int padright, int chainsize,
|
||||
bool wiggle, bool translate)
|
||||
{
|
||||
if(value > 100)
|
||||
value = 100;
|
||||
|
@ -1719,18 +1731,20 @@ private:
|
|||
if(wiggle)
|
||||
y += chainWiggle;
|
||||
int gemWidth = gem->GetWidth();
|
||||
int offset = (int) (((double) (size-gemWidth)/100)*value);
|
||||
int chainWidth = chain->GetWidth();
|
||||
int offset = (int) (((double) (chainWidth-padleft-padright)/100)*value);
|
||||
if(chain != NULL)
|
||||
{
|
||||
DrawImage(chain, x+offset, y);
|
||||
DrawImage(chain, x-chain->GetWidth()+offset+7, y);
|
||||
DrawImage(chain, x+(offset%chainsize), y);
|
||||
}
|
||||
if(gem != NULL)
|
||||
DrawImage(gem, x-gemWidth+offset, y, translate ? /*translationtables[TRANSLATION_Players] + (CPlayer-players)*256*/ getTranslation() : NULL);
|
||||
DrawImage(gem, x+padleft+offset, y, translate ? getTranslation() : NULL);
|
||||
}
|
||||
|
||||
BYTE* getTranslation()
|
||||
{
|
||||
if(gameinfo.gametype & GAME_Raven)
|
||||
return translationtables[TRANSLATION_PlayersExtra] + (CPlayer - players)*256;
|
||||
return translationtables[TRANSLATION_Players] + (CPlayer - players)*256;
|
||||
}
|
||||
|
||||
|
|
|
@ -1025,7 +1025,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
FriendlyFire = true;
|
||||
if (damage < 1000000)
|
||||
{ // Still allow telefragging :-(
|
||||
damage = (int)((float)damage * teamdamage);
|
||||
damage = (int)((float)damage * level.teamdamage);
|
||||
if (damage <= 0)
|
||||
return;
|
||||
}
|
||||
|
@ -1290,7 +1290,7 @@ void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poi
|
|||
}
|
||||
if (source != NULL && source->player != player && player->mo->IsTeammate (source))
|
||||
{
|
||||
poison = (int)((float)poison * teamdamage);
|
||||
poison = (int)((float)poison * level.teamdamage);
|
||||
}
|
||||
if (poison > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue