- Added Karate Chris's teamdamage in MAPINFO submission.

- Added Blzut3's second SBARINFO update.


SVN r621 (trunk)
This commit is contained in:
Christoph Oelckers 2007-12-22 22:04:20 +00:00
parent aacb694200
commit 4131ec141d
7 changed files with 47 additions and 14 deletions

View file

@ -1,4 +1,7 @@
December 22, 2007 (Changes by Graf Zahl) 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. - Added Blzut3's SBARINFO update.
December 21, 2007 December 21, 2007

View file

@ -51,7 +51,11 @@ CVAR (Bool, var_friction, true, CVAR_SERVERINFO);
CVAR (Bool, var_pushers, true, CVAR_SERVERINFO); CVAR (Bool, var_pushers, true, CVAR_SERVERINFO);
CVAR (Bool, alwaysapplydmflags, false, 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) CUSTOM_CVAR (String, language, "auto", CVAR_ARCHIVE)
{ {

View file

@ -438,7 +438,7 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage)
} }
else else
{ {
dopoison = victim->player->poisoncount < (int)(4.f * teamdamage); dopoison = victim->player->poisoncount < (int)(4.f * level.teamdamage);
} }
if (dopoison) if (dopoison)
@ -446,7 +446,7 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage)
int damage = 15 + (pr_poisoncloudd()&15); int damage = 15 + (pr_poisoncloudd()&15);
if (mate) if (mate)
{ {
damage = (int)((float)damage * teamdamage); damage = (int)((float)damage * level.teamdamage);
} }
if (damage > 0) if (damage > 0)
{ {

View file

@ -299,6 +299,7 @@ static const char *MapInfoMapLevel[] =
"infiniteflightpowerup", "infiniteflightpowerup",
"noinfiniteflightpowerup", "noinfiniteflightpowerup",
"allowrespawn", "allowrespawn",
"teamdamage",
NULL NULL
}; };
@ -440,6 +441,7 @@ MapHandlers[] =
{ MITYPE_SETFLAG, LEVEL_INFINITE_FLIGHT, 0 }, { MITYPE_SETFLAG, LEVEL_INFINITE_FLIGHT, 0 },
{ MITYPE_CLRFLAG, LEVEL_INFINITE_FLIGHT, 0 }, { MITYPE_CLRFLAG, LEVEL_INFINITE_FLIGHT, 0 },
{ MITYPE_SETFLAG, LEVEL_ALLOWRESPAWN, 0 }, { MITYPE_SETFLAG, LEVEL_ALLOWRESPAWN, 0 },
{ MITYPE_FLOAT, lioffset(teamdamage), 0 },
}; };
static const char *MapInfoClusterLevel[] = static const char *MapInfoClusterLevel[] =
@ -2259,6 +2261,7 @@ void G_InitLevelLocals ()
level.gravity = sv_gravity * 35/TICRATE; level.gravity = sv_gravity * 35/TICRATE;
level.aircontrol = (fixed_t)(sv_aircontrol * 65536.f); level.aircontrol = (fixed_t)(sv_aircontrol * 65536.f);
level.teamdamage = teamdamage;
level.flags = 0; level.flags = 0;
info = FindLevelInfo (level.mapname); info = FindLevelInfo (level.mapname);
@ -2297,6 +2300,10 @@ void G_InitLevelLocals ()
{ {
level.aircontrol = (fixed_t)(info->aircontrol * 65536.f); level.aircontrol = (fixed_t)(info->aircontrol * 65536.f);
} }
if (info->teamdamage != 0.f)
{
level.teamdamage = info->teamdamage;
}
G_AirControlChanged (); G_AirControlChanged ();
@ -2621,6 +2628,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
<< level.killed_monsters << level.killed_monsters
<< level.gravity << level.gravity
<< level.aircontrol << level.aircontrol
<< level.teamdamage
<< level.maptime << level.maptime
<< i; << i;

View file

@ -175,6 +175,8 @@ struct level_info_s
char sndseq[9]; char sndseq[9];
char bordertexture[9]; char bordertexture[9];
FSpecialAction * specialactions; FSpecialAction * specialactions;
float teamdamage;
}; };
typedef struct level_info_s level_info_t; typedef struct level_info_s level_info_t;
@ -242,6 +244,8 @@ struct level_locals_s
const char *f1; const char *f1;
float teamdamage;
bool IsJumpingAllowed() const; bool IsJumpingAllowed() const;
bool IsCrouchingAllowed() const; bool IsCrouchingAllowed() const;
bool IsFreelookAllowed() const; bool IsFreelookAllowed() const;

View file

@ -15,6 +15,7 @@
#include "i_system.h" #include "i_system.h"
#include "sbarinfo.h" #include "sbarinfo.h"
#include "sc_man.h" #include "sc_man.h"
#include "gi.h"
static FRandom pr_chainwiggle; //use the same method of chain wiggling as heretic. 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); cmd.sprite = newImage(sc_String);
SC_MustGetToken(','); SC_MustGetToken(',');
SC_MustGetToken(TK_IntConst); SC_MustGetToken(TK_IntConst);
if(sc_Number <= 0) if(sc_Number < 0)
SC_ScriptError("Size must be a positive number."); SC_ScriptError("Left padding must be a positive number.");
cmd.special2 = sc_Number; cmd.special2 = sc_Number;
SC_MustGetToken(','); SC_MustGetToken(',');
SC_MustGetToken(TK_IntConst); 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; cmd.x = sc_Number;
SC_MustGetToken(','); SC_MustGetToken(',');
SC_MustGetToken(TK_IntConst); SC_MustGetToken(TK_IntConst);
@ -1467,7 +1478,7 @@ private:
{ {
wiggle = (cmd.flags & DRAWGEM_WIGGLE) == DRAWGEM_WIGGLE; 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; break;
} }
case SBARINFO_GAMEMODE: case SBARINFO_GAMEMODE:
@ -1499,7 +1510,7 @@ private:
y -= (texture->GetHeight()/2)-texture->TopOffset; y -= (texture->GetHeight()/2)-texture->TopOffset;
} }
if((flags & DRAWIMAGE_TRANSLATABLE) == DRAWIMAGE_TRANSLATABLE) if((flags & DRAWIMAGE_TRANSLATABLE) == DRAWIMAGE_TRANSLATABLE)
DrawImage(texture, x, y, translationtables[TRANSLATION_Players] + (CPlayer - players)*256); DrawImage(texture, x, y, getTranslation());
else else
DrawImage(texture, x, y); DrawImage(texture, x, y);
} }
@ -1710,7 +1721,8 @@ private:
} }
//draws heretic/hexen style life gems //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) if(value > 100)
value = 100; value = 100;
@ -1719,18 +1731,20 @@ private:
if(wiggle) if(wiggle)
y += chainWiggle; y += chainWiggle;
int gemWidth = gem->GetWidth(); 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) if(chain != NULL)
{ {
DrawImage(chain, x+offset, y); DrawImage(chain, x+(offset%chainsize), y);
DrawImage(chain, x-chain->GetWidth()+offset+7, y);
} }
if(gem != NULL) 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() BYTE* getTranslation()
{ {
if(gameinfo.gametype & GAME_Raven)
return translationtables[TRANSLATION_PlayersExtra] + (CPlayer - players)*256;
return translationtables[TRANSLATION_Players] + (CPlayer - players)*256; return translationtables[TRANSLATION_Players] + (CPlayer - players)*256;
} }

View file

@ -1025,7 +1025,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
FriendlyFire = true; FriendlyFire = true;
if (damage < 1000000) if (damage < 1000000)
{ // Still allow telefragging :-( { // Still allow telefragging :-(
damage = (int)((float)damage * teamdamage); damage = (int)((float)damage * level.teamdamage);
if (damage <= 0) if (damage <= 0)
return; 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)) if (source != NULL && source->player != player && player->mo->IsTeammate (source))
{ {
poison = (int)((float)poison * teamdamage); poison = (int)((float)poison * level.teamdamage);
} }
if (poison > 0) if (poison > 0)
{ {