- Sync scripting branch with what was in trunk on Sunday. I believe that would be revision 2739.

SVN r2790 (scripting)
This commit is contained in:
Randy Heit 2010-09-16 03:14:32 +00:00
commit 99670b708c
317 changed files with 17299 additions and 7273 deletions

View file

@ -35,12 +35,14 @@
#include <ctype.h>
#include "doomstat.h"
#include "d_player.h"
#include "g_level.h"
#include "g_game.h"
#include "gi.h"
#include "templates.h"
#include "v_font.h"
#include "m_fixed.h"
#include "gstrings.h"
TArray<FSkillInfo> AllSkills;
int DefaultSkill = -1;
@ -70,7 +72,6 @@ void FMapInfoParser::ParseSkill ()
skill.Aggressiveness = FRACUNIT;
skill.SpawnFilter = 0;
skill.ACSReturn = 0;
skill.MenuNameIsLump = false;
skill.MustConfirm = false;
skill.Shortcut = 0;
skill.TextColor = "";
@ -79,6 +80,7 @@ void FMapInfoParser::ParseSkill ()
skill.MonsterHealth = FRACUNIT;
skill.FriendlyHealth = FRACUNIT;
skill.NoPain = false;
skill.ArmorFactor = FRACUNIT;
sc.MustGetString();
skill.Name = sc.String;
@ -185,7 +187,6 @@ void FMapInfoParser::ParseSkill ()
ParseAssign();
sc.MustGetString ();
skill.MenuName = sc.String;
skill.MenuNameIsLump = false;
}
else if (sc.Compare("PlayerClassName"))
{
@ -200,8 +201,7 @@ void FMapInfoParser::ParseSkill ()
{
ParseAssign();
sc.MustGetString ();
skill.MenuName = sc.String;
skill.MenuNameIsLump = true;
skill.PicName = sc.String;
}
else if (sc.Compare("MustConfirm"))
{
@ -250,6 +250,12 @@ void FMapInfoParser::ParseSkill ()
{
skill.NoPain = true;
}
else if (sc.Compare("ArmorFactor"))
{
ParseAssign();
sc.MustGetFloat();
skill.ArmorFactor = FLOAT2FIXED(sc.Float);
}
else if (sc.Compare("DefaultSkill"))
{
if (DefaultSkill >= 0)
@ -358,12 +364,38 @@ int G_SkillProperty(ESkillProperty prop)
return AllSkills[gameskill].FriendlyHealth;
case SKILLP_NoPain:
return AllSkills[gameskill].NoPain;
return AllSkills[gameskill].NoPain;
case SKILLP_ArmorFactor:
return AllSkills[gameskill].ArmorFactor;
}
}
return 0;
}
//==========================================================================
//
//
//
//==========================================================================
const char * G_SkillName()
{
const char *name = AllSkills[gameskill].MenuName;
player_t *player = &players[consoleplayer];
const char *playerclass = player->mo->GetClass()->DisplayName;
if (playerclass != NULL)
{
FString * pmnm = AllSkills[gameskill].MenuNamesForPlayerClass.CheckKey(playerclass);
if (pmnm != NULL) name = *pmnm;
}
if (*name == '$') name = GStrings(name+1);
return name;
}
//==========================================================================
//
@ -402,8 +434,8 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
SpawnFilter = other.SpawnFilter;
ACSReturn = other.ACSReturn;
MenuName = other.MenuName;
PicName = other.PicName;
MenuNamesForPlayerClass = other.MenuNamesForPlayerClass;
MenuNameIsLump = other.MenuNameIsLump;
MustConfirm = other.MustConfirm;
MustConfirmText = other.MustConfirmText;
Shortcut = other.Shortcut;
@ -413,6 +445,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
MonsterHealth = other.MonsterHealth;
FriendlyHealth = other.FriendlyHealth;
NoPain = other.NoPain;
ArmorFactor = other.ArmorFactor;
return *this;
}