"Monster-Fraktion geniesst Welpen-Schutz"
This commit is contained in:
Enno Rehling 2009-08-28 20:04:46 +00:00
parent b067c1d511
commit b1ac90ff63
6 changed files with 11 additions and 9 deletions

View File

@ -2927,7 +2927,7 @@ steal_cmd(unit * u, struct order * ord, request ** stealorders)
return;
}
if (u2->faction->age < NewbieImmunity()) {
if (IsImmune(u2->faction)) {
ADDMSG(&u->faction->msgs,
msg_feedback(u, ord, "newbie_immunity_error",
"turns", NewbieImmunity()));

View File

@ -2603,7 +2603,7 @@ can_start_guarding(const unit * u)
if (u->status>=ST_FLEE) return E_GUARD_FLEEING;
if (fval(u->race, RCF_UNARMEDGUARD)) return E_GUARD_OK;
if (!armedmen(u, true)) return E_GUARD_UNARMED;
if (u->faction->age < NewbieImmunity()) return E_GUARD_NEWBIE;
if (IsImmune(u->faction)) return E_GUARD_NEWBIE;
return E_GUARD_OK;
}

View File

@ -4028,7 +4028,7 @@ init_battle(region * r, battle **bp)
cmistake(u, ord, 47, MSG_BATTLE);
continue;
}
if (u2->faction->age < NewbieImmunity()) {
if (IsImmune(u2->faction)) {
add_message(&u->faction->msgs,
msg_feedback(u, u->thisorder, "newbie_immunity_error", "turns", NewbieImmunity()));
continue;

View File

@ -117,6 +117,7 @@ attrib_type at_xontormiaexpress = {
ATF_UNIQUE
};
#endif
int
NewbieImmunity(void) {
static int value = -1;
@ -126,6 +127,12 @@ NewbieImmunity(void) {
return value;
}
boolean
IsImmune(const faction * f)
{
return !fval(f, FFL_NPC) && f->age < NewbieImmunity();
}
static int
MaxAge(void) {
static int value = -1;

View File

@ -405,6 +405,7 @@ extern int NMRTimeout(void);
extern int LongHunger(const struct unit * u);
extern int SkillCap(skill_t sk);
extern int NewbieImmunity(void);
extern boolean IsImmune(const struct faction * f);
extern int AllianceAuto(void); /* flags that allied factions get automatically */
extern int AllianceRestricted(void); /* flags restricted to allied factions */
extern int HelpMask(void); /* flags restricted to allied factions */

View File

@ -1,7 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util.vcproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel.vcproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamecode", "common\gamecode.vcproj", "{1E8BFF9E-3044-0742-992F-C5765B80FE65}"
@ -21,10 +19,6 @@ Global
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Debug|Win32.ActiveCfg = Debug|Win32
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Profile|Win32.ActiveCfg = Profile|Win32
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Profile|Win32.Build.0 = Profile|Win32
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Release|Win32.ActiveCfg = Release|Win32
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Debug|Win32.ActiveCfg = Debug|Win32
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Profile|Win32.ActiveCfg = Profile|Win32
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Profile|Win32.Build.0 = Profile|Win32