forked from github/server
- make monster-equipment configurable
- rename some SK_ constants to match their name
This commit is contained in:
parent
78615978c8
commit
1b93b094e4
20 changed files with 63 additions and 63 deletions
|
@ -265,8 +265,8 @@ add_recruits(unit * u, int number, int wanted)
|
|||
change_level(unew, SK_CROSSBOW, i);
|
||||
if (unew->race->bonus[SK_RIDING] >= 0)
|
||||
change_level(unew, SK_RIDING, i);
|
||||
if (unew->race->bonus[SK_AUSDAUER] >= 0)
|
||||
change_level(unew, SK_AUSDAUER, i);
|
||||
if (unew->race->bonus[SK_STAMINA] >= 0)
|
||||
change_level(unew, SK_STAMINA, i);
|
||||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
if (unew!=u) {
|
||||
|
@ -2742,8 +2742,8 @@ wahrnehmung(region * r, faction * f)
|
|||
|
||||
for (u = r->units; u; u = u->next) {
|
||||
if (u->faction == f) {
|
||||
if (eff_skill(u, SK_OBSERVATION, r) > w) {
|
||||
w = eff_skill(u, SK_OBSERVATION, r);
|
||||
if (eff_skill(u, SK_PERCEPTION, r) > w) {
|
||||
w = eff_skill(u, SK_PERCEPTION, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -910,7 +910,7 @@ plan_dragon(unit * u)
|
|||
}
|
||||
if (long_order==NULL) {
|
||||
long_order = create_order(K_STUDY, u->faction->locale, "'%s'",
|
||||
skillname(SK_OBSERVATION, u->faction->locale));
|
||||
skillname(SK_PERCEPTION, u->faction->locale));
|
||||
}
|
||||
return long_order;
|
||||
}
|
||||
|
@ -946,7 +946,7 @@ plan_monsters(void)
|
|||
/* all monsters fight */
|
||||
}
|
||||
/* Monster bekommen jede Runde ein paar Tage Wahrnehmung dazu */
|
||||
produceexp(u, SK_OBSERVATION, u->number);
|
||||
produceexp(u, SK_PERCEPTION, u->number);
|
||||
|
||||
/* Befehle müssen jede Runde neu gegeben werden: */
|
||||
free_orders(&u->orders);
|
||||
|
@ -1069,10 +1069,7 @@ spawn_dragons(void)
|
|||
if (fval(r->terrain, SEA_REGION) && rng_int()%10000 < 1) {
|
||||
u = createunit(r, monsters, 1, new_race[RC_SEASERPENT]);
|
||||
fset(u, UFL_ISNEW|UFL_MOVED);
|
||||
set_level(u, SK_MAGIC, 4);
|
||||
set_level(u, SK_OBSERVATION, 3);
|
||||
set_level(u, SK_STEALTH, 2);
|
||||
set_level(u, SK_AUSDAUER, 1);
|
||||
equip_unit(u, get_equipment("monster_seaserpent"));
|
||||
}
|
||||
|
||||
if ((rterrain(r) == T_GLACIER || r->terrain == newterrain(T_SWAMP) || rterrain(r) == T_DESERT) && rng_int() % 10000 < (5 + 100 * chaosfactor(r)))
|
||||
|
@ -1083,12 +1080,8 @@ spawn_dragons(void)
|
|||
u = createunit(r, monsters, nrand(30, 20) + 1, new_race[RC_DRAGON]);
|
||||
}
|
||||
fset(u, UFL_ISNEW|UFL_MOVED);
|
||||
equip_unit(u, get_equipment("monster_dragon"));
|
||||
|
||||
set_money(u, u->number * (rng_int() % 500 + 100));
|
||||
set_level(u, SK_MAGIC, 4);
|
||||
set_level(u, SK_OBSERVATION, 1+rng_int()%3);
|
||||
set_level(u, SK_STEALTH, 1);
|
||||
set_level(u, SK_AUSDAUER, 1);
|
||||
if (!quiet) {
|
||||
log_printf("%d %s in %s.\n", u->number,
|
||||
LOC(default_locale, rc_name(u->race, u->number!=1)), regionname(r, NULL));
|
||||
|
@ -1098,20 +1091,7 @@ spawn_dragons(void)
|
|||
|
||||
/* add message to the region */
|
||||
ADDMSG(&r->msgs,
|
||||
msg_message("sighting", "region race number",
|
||||
NULL, u->race, u->number));
|
||||
/* create new message to add to units */
|
||||
msg = msg_message("sighting", "region race number",
|
||||
u->region, u->race, u->number);
|
||||
for (u=r->units;u;u=u->next) freset(u->faction, FFL_SELECT);
|
||||
for (u=r->units;u;u=u->next) {
|
||||
faction * f = u->faction;
|
||||
if (!fval(f, FFL_SELECT)) {
|
||||
add_message(&f->msgs, msg);
|
||||
fset(f, FFL_SELECT);
|
||||
}
|
||||
}
|
||||
msg_release(msg);
|
||||
msg_message("sighting", "region race number", r, u->race, u->number));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,7 +289,7 @@ get_allies(region * r, unit * u)
|
|||
break;
|
||||
|
||||
case T_SWAMP:
|
||||
if (eff_skill(u, SK_OBSERVATION, r) <= 3) {
|
||||
if (eff_skill(u, SK_PERCEPTION, r) <= 3) {
|
||||
return;
|
||||
}
|
||||
name = "random_swamp_men";
|
||||
|
|
|
@ -151,7 +151,7 @@ spy_cmd(unit * u, struct order * ord)
|
|||
|
||||
/* der Spion kann identifiziert werden, wenn das Opfer bessere
|
||||
* Wahrnehmung als das Ziel Tarnung + Spionage/2 hat */
|
||||
observe = eff_skill(target, SK_OBSERVATION, r)
|
||||
observe = eff_skill(target, SK_PERCEPTION, r)
|
||||
- (effskill(u, SK_STEALTH) + eff_skill(u, SK_SPY, r)/2);
|
||||
|
||||
if (invisible(u, target) >= u->number) {
|
||||
|
@ -162,7 +162,7 @@ spy_cmd(unit * u, struct order * ord)
|
|||
* Spionageversuch bemerkt wurde. Die Wahrscheinlich dafür ist (100 -
|
||||
* SpionageSpion*5 + WahrnehmungOpfer*2)%. */
|
||||
observechance = 1.0 - (eff_skill(u, SK_SPY, r) * 0.05)
|
||||
+ (eff_skill(target, SK_OBSERVATION, r) * 0.02);
|
||||
+ (eff_skill(target, SK_PERCEPTION, r) * 0.02);
|
||||
|
||||
if (chance(observechance)) {
|
||||
ADDMSG(&target->faction->msgs, msg_message("spydetect",
|
||||
|
@ -553,7 +553,7 @@ sink_ship(region * r, ship * sh, const char *name, char spy, unit * saboteur)
|
|||
}
|
||||
add_message(&f->msgs, sink_msg);
|
||||
vset_erase(&informed, f);
|
||||
if (spy == 1 && f != saboteur->faction && faction_skill(r, f, SK_OBSERVATION) - eff_skill(saboteur, SK_STEALTH, r) > 0) {
|
||||
if (spy == 1 && f != saboteur->faction && faction_skill(r, f, SK_PERCEPTION) - eff_skill(saboteur, SK_STEALTH, r) > 0) {
|
||||
/* the unit is discovered */
|
||||
ADDMSG(&f->msgs, msg_message("spy_discovered_msg", "unit saboteur ship", lastunit, saboteur, sh));
|
||||
if (enemy_discovers_spy_msg==NULL) {
|
||||
|
@ -595,7 +595,7 @@ sabotage_cmd(unit * u, struct order * ord)
|
|||
return 0;
|
||||
}
|
||||
u2 = shipowner(sh);
|
||||
skdiff = eff_skill(u, SK_SPY, r)-crew_skill(r, u2->faction, sh, SK_OBSERVATION);
|
||||
skdiff = eff_skill(u, SK_SPY, r)-crew_skill(r, u2->faction, sh, SK_PERCEPTION);
|
||||
if (try_destruction(u, u2, sh, skdiff)) {
|
||||
sink_ship(r, sh, buffer, 1, u);
|
||||
}
|
||||
|
|
|
@ -645,7 +645,7 @@ learn_cmd(unit * u, order * ord)
|
|||
if (l > 0) {
|
||||
if (sk == SK_CROSSBOW || sk == SK_LONGBOW
|
||||
|| sk == SK_CATAPULT || sk == SK_MELEE || sk == SK_SPEAR
|
||||
|| sk == SK_AUSDAUER || sk == SK_WEAPONLESS)
|
||||
|| sk == SK_STAMINA || sk == SK_WEAPONLESS)
|
||||
{
|
||||
teach->value += u->number * 5 * (l+1);
|
||||
} else {
|
||||
|
|
|
@ -2085,7 +2085,7 @@ do_regenerate(fighter *af)
|
|||
ta.index = af->fighting;
|
||||
|
||||
while(ta.index--) {
|
||||
af->person[ta.index].hp += effskill(au, SK_AUSDAUER);
|
||||
af->person[ta.index].hp += effskill(au, SK_STAMINA);
|
||||
af->person[ta.index].hp = min(unit_max_hp(au), af->person[ta.index].hp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -333,7 +333,7 @@ b_blockfogwall(const border * b, const unit * u, const region * r)
|
|||
unused(b);
|
||||
unused(r);
|
||||
if (!u) return true;
|
||||
return (boolean)(effskill(u, SK_OBSERVATION) > 4); /* Das ist die alte Nebelwand */
|
||||
return (boolean)(effskill(u, SK_PERCEPTION) > 4); /* Das ist die alte Nebelwand */
|
||||
}
|
||||
|
||||
border_type bt_fogwall = {
|
||||
|
|
|
@ -106,7 +106,7 @@ slipthru(const region * r, const unit * u, const building * b)
|
|||
|
||||
if (invisible(u, u2) >= u->number) continue;
|
||||
|
||||
o = eff_skill(u2, SK_OBSERVATION, r);
|
||||
o = eff_skill(u2, SK_PERCEPTION, r);
|
||||
|
||||
if (o + 2 >= n)
|
||||
return 0; /* entdeckt! */
|
||||
|
|
|
@ -1037,7 +1037,7 @@ cansee(const faction * f, const region * r, const unit * u, int modifier)
|
|||
rings = invisible(u, NULL);
|
||||
while (u2) {
|
||||
if (rings<u->number || invisible(u, u2) < u->number) {
|
||||
int observation = eff_skill(u2, SK_OBSERVATION, r);
|
||||
int observation = eff_skill(u2, SK_PERCEPTION, r);
|
||||
|
||||
#ifdef NIGHTEYES
|
||||
if (u2->enchanted == SP_NIGHT_EYES && o < NIGHT_EYE_TALENT)
|
||||
|
@ -1078,7 +1078,7 @@ cansee_unit(const unit * u, const unit * target, int modifier)
|
|||
if (rings && invisible(target, u) >= target->number) {
|
||||
return false;
|
||||
}
|
||||
o = eff_skill(u, SK_OBSERVATION, target->region);
|
||||
o = eff_skill(u, SK_PERCEPTION, target->region);
|
||||
|
||||
#ifdef NIGHTEYES
|
||||
if (u->enchanted == SP_NIGHT_EYES && o < NIGHT_EYE_TALENT)
|
||||
|
@ -1121,7 +1121,7 @@ cansee_durchgezogen(const faction * f, const region * r, const unit * u, int mod
|
|||
|
||||
if (rings && invisible(u, u2) >= u->number) continue;
|
||||
|
||||
o = eff_skill(u2, SK_OBSERVATION, r);
|
||||
o = eff_skill(u2, SK_PERCEPTION, r);
|
||||
|
||||
#ifdef NIGHTEYES
|
||||
if (u2->enchanted == SP_NIGHT_EYES && o < NIGHT_EYE_TALENT)
|
||||
|
@ -1853,7 +1853,7 @@ get_lighthouses(const region * r)
|
|||
if (u->building == b) {
|
||||
c = true;
|
||||
if (c > buildingcapacity(b)) break;
|
||||
if (eff_skill(u, SK_OBSERVATION, r) >= d * 3) {
|
||||
if (eff_skill(u, SK_PERCEPTION, r) >= d * 3) {
|
||||
unitlist_insert(&ulist, u);
|
||||
}
|
||||
} else if (c) break; /* first unit that's no longer in the house ends the search */
|
||||
|
@ -1878,7 +1878,7 @@ lighthouse_range(const building * b, const faction * f)
|
|||
c += u->number;
|
||||
if (c > buildingcapacity(b)) break;
|
||||
if (f==NULL || u->faction == f) {
|
||||
int sk = eff_skill(u, SK_OBSERVATION, r) / 3;
|
||||
int sk = eff_skill(u, SK_PERCEPTION, r) / 3;
|
||||
d = max(d, sk);
|
||||
d = min(maxd, d);
|
||||
if (d==maxd) break;
|
||||
|
@ -1914,7 +1914,7 @@ check_leuchtturm(region * r, faction * f)
|
|||
if (f==NULL || u->faction == f) {
|
||||
if (!d) d = distance(r, r2);
|
||||
if (maxd < d) break;
|
||||
if (eff_skill(u, SK_OBSERVATION, r) >= d * 3) return true;
|
||||
if (eff_skill(u, SK_PERCEPTION, r) >= d * 3) return true;
|
||||
}
|
||||
} else if (c) break; /* first unit that's no longer in the house ends the search */
|
||||
}
|
||||
|
|
|
@ -819,7 +819,7 @@ use_foolpotion(struct unit *u, int targetno, const struct item_type *itype, int
|
|||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return ECUSTOM;
|
||||
}
|
||||
if (effskill(u, SK_STEALTH)<=effskill(target, SK_OBSERVATION)) {
|
||||
if (effskill(u, SK_STEALTH)<=effskill(target, SK_PERCEPTION)) {
|
||||
cmistake(u, ord, 64, MSG_EVENT);
|
||||
return ECUSTOM;
|
||||
}
|
||||
|
|
|
@ -828,7 +828,7 @@ bewegung_blockiert_von(unit * reisender, region * r)
|
|||
if (fval(reisender->race, RCF_ILLUSIONARY)) return NULL;
|
||||
for (u=r->units;u && !contact;u=u->next) {
|
||||
if (getguard(u) & GUARD_TRAVELTHRU) {
|
||||
int sk = eff_skill(u, SK_OBSERVATION, r);
|
||||
int sk = eff_skill(u, SK_PERCEPTION, r);
|
||||
if (invisible(reisender, u) >= reisender->number) continue;
|
||||
if (u->faction == reisender->faction) contact = true;
|
||||
else if (ucontact(u, reisender)) contact = true;
|
||||
|
@ -1813,7 +1813,7 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
|
|||
!alliedunit(hafenmeister, u->faction, HELP_GUARD)) {
|
||||
|
||||
|
||||
if (effskill(hafenmeister, SK_OBSERVATION) > effskill(u2, SK_STEALTH)) {
|
||||
if (effskill(hafenmeister, SK_PERCEPTION) > effskill(u2, SK_STEALTH)) {
|
||||
for (itm=u2->items; itm; itm=itm->next) {
|
||||
const luxury_type * ltype = resource2luxury(itm->type->rtype);
|
||||
if (ltype!=NULL && itm->number>0) {
|
||||
|
|
|
@ -202,7 +202,7 @@ unit_max_hp(const unit * u)
|
|||
if (heal_ct==NULL) heal_ct = ct_find("healingzone");
|
||||
|
||||
|
||||
p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2;
|
||||
p = pow(effskill(u, SK_STAMINA) / 2.0, 1.5) * 0.2;
|
||||
h += (int) (h * p + 0.5);
|
||||
|
||||
#if KARMA_MODULE
|
||||
|
|
|
@ -1094,7 +1094,7 @@ view_regatta(struct seen_region ** seen, region * r, faction * f)
|
|||
int skill = 0;
|
||||
for (u=r->units; u; u=u->next) {
|
||||
if (u->faction==f) {
|
||||
int es = effskill(u, SK_OBSERVATION);
|
||||
int es = effskill(u, SK_PERCEPTION);
|
||||
if (es>skill) skill=es;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ rc_skillmod(const struct race * rc, const region *r, skill_t sk)
|
|||
mods = skill_mod(rc, sk, r->terrain);
|
||||
#endif
|
||||
if (rc == new_race[RC_ELF] && r_isforest(r)) switch (sk) {
|
||||
case SK_OBSERVATION:
|
||||
case SK_PERCEPTION:
|
||||
++mods;
|
||||
break;
|
||||
case SK_STEALTH:
|
||||
|
|
|
@ -152,9 +152,8 @@ spawn_braineaters(float chance)
|
|||
/* Neues Monster ? */
|
||||
if (next-- == 0) {
|
||||
unit *u = createunit(r, f0, 1+rng_int()%10+rng_int()%10, new_race[RC_HIRNTOETER]);
|
||||
equip_unit(u, get_equipment("monster_braineater"));
|
||||
|
||||
set_level(u, SK_STEALTH, 1);
|
||||
set_level(u, SK_OBSERVATION, 1);
|
||||
next = rng_int() % (int)(chance*100);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -297,9 +297,9 @@ enum {
|
|||
SK_ENTERTAINMENT,
|
||||
SK_WEAPONSMITH,
|
||||
SK_CARTMAKER,
|
||||
SK_OBSERVATION,
|
||||
SK_PERCEPTION,
|
||||
SK_TAXING,
|
||||
SK_AUSDAUER,
|
||||
SK_STAMINA,
|
||||
SK_WEAPONLESS,
|
||||
MAXSKILLS,
|
||||
NOSKILL = (skill_t) -1
|
||||
|
|
|
@ -1134,7 +1134,7 @@ item_modification(const unit *u, skill_t sk, int val)
|
|||
}
|
||||
}
|
||||
#if NEWATSROI == 1
|
||||
if(sk == SK_OBSERVATION) {
|
||||
if(sk == SK_PERCEPTION) {
|
||||
if(get_item(u, I_AMULET_OF_TRUE_SEEING) >= u->number) {
|
||||
val += ATSBONUS;
|
||||
}
|
||||
|
@ -1226,7 +1226,7 @@ case SK_HERBALISM:
|
|||
case SK_MAGIC:
|
||||
case SK_SPY:
|
||||
case SK_STEALTH:
|
||||
case SK_OBSERVATION:
|
||||
case SK_PERCEPTION:
|
||||
break;
|
||||
default:
|
||||
skill -= 2;
|
||||
|
|
|
@ -784,7 +784,7 @@ sp_shadowcall(fighter * fi, int level, double power, spell * sp)
|
|||
setstatus(u, ST_FIGHT);
|
||||
|
||||
set_level(u, SK_WEAPONLESS, (int)(power/2));
|
||||
set_level(u, SK_AUSDAUER, (int)(power/2));
|
||||
set_level(u, SK_STAMINA, (int)(power/2));
|
||||
u->hp = u->number * unit_max_hp(u);
|
||||
|
||||
a = a_new(&at_unitdissolve);
|
||||
|
@ -814,7 +814,7 @@ sp_wolfhowl(fighter * fi, int level, double power, spell * sp)
|
|||
setstatus(u, ST_FIGHT);
|
||||
|
||||
set_level(u, SK_WEAPONLESS, (int)(power/3));
|
||||
set_level(u, SK_AUSDAUER, (int)(power/3));
|
||||
set_level(u, SK_STAMINA, (int)(power/3));
|
||||
u->hp = u->number * unit_max_hp(u);
|
||||
|
||||
if (fval(mage, UFL_PARTEITARNUNG))
|
||||
|
|
|
@ -3318,7 +3318,7 @@ sp_summonshadow(castorder *co)
|
|||
val = get_level(mage, SK_MAGIC) + get_level(mage, SK_STEALTH);
|
||||
|
||||
set_level(u, SK_STEALTH, val);
|
||||
set_level(u, SK_OBSERVATION, 1);
|
||||
set_level(u, SK_PERCEPTION, 1);
|
||||
|
||||
ADDMSG(&mage->faction->msgs, msg_message("summonshadow_effect",
|
||||
"mage number", mage, number));
|
||||
|
@ -3356,7 +3356,7 @@ sp_summonshadowlords(castorder *co)
|
|||
|
||||
/* Bekommen Tarnung = Magie und Wahrnehmung 5. */
|
||||
set_level(u, SK_STEALTH, get_level(mage, SK_MAGIC));
|
||||
set_level(u, SK_OBSERVATION, 5);
|
||||
set_level(u, SK_PERCEPTION, 5);
|
||||
|
||||
ADDMSG(&mage->faction->msgs, msg_message("summon_effect", "mage amount race", mage, 1, u->race));
|
||||
return cast_level;
|
||||
|
@ -4326,7 +4326,7 @@ sp_pump(castorder *co)
|
|||
|
||||
u = create_unit(rt, mage->faction, RS_FARVISION, new_race[RC_SPELL], 0, "spell/pump", NULL);
|
||||
u->age = 2;
|
||||
set_level(u, SK_OBSERVATION, eff_skill(target, SK_OBSERVATION, u->region));
|
||||
set_level(u, SK_PERCEPTION, eff_skill(target, SK_PERCEPTION, u->region));
|
||||
|
||||
return cast_level;
|
||||
}
|
||||
|
@ -5061,7 +5061,7 @@ sp_dreamreading(castorder *co)
|
|||
u2 = create_unit(u->region,mage->faction, RS_FARVISION, new_race[RC_SPELL], 0, "spell/dreamreading", NULL);
|
||||
set_number(u2, 1);
|
||||
u2->age = 2; /* Nur für diese Runde. */
|
||||
set_level(u2, SK_OBSERVATION, eff_skill(u, SK_OBSERVATION, u2->region));
|
||||
set_level(u2, SK_PERCEPTION, eff_skill(u, SK_PERCEPTION, u2->region));
|
||||
|
||||
msg = msg_message("sp_dreamreading_effect", "mage unit region", mage, u, u->region);
|
||||
r_addmessage(r, mage->faction, msg);
|
||||
|
@ -5868,7 +5868,7 @@ sp_viewreality(castorder *co)
|
|||
region * rt = rl2->data;
|
||||
if (!is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
|
||||
u = create_unit(rt, mage->faction, RS_FARVISION, new_race[RC_SPELL], 0, "spell/viewreality", NULL);
|
||||
set_level(u, SK_OBSERVATION, co->level/2);
|
||||
set_level(u, SK_PERCEPTION, co->level/2);
|
||||
u->age = 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -379,5 +379,26 @@
|
|||
<item name="seaserpenthead" amount="1"/>
|
||||
</set>
|
||||
|
||||
<!-- sets that are used by the monster-spawning code -->
|
||||
<set name="monster_dragon">
|
||||
<skill name="magic" level="4"/>
|
||||
<skill name="stealth" level="1"/>
|
||||
<skill name="stamina" level="1"/>
|
||||
<skill name="perception" level="d3"/>
|
||||
<item name="money" amount="d500+99"/>
|
||||
</set>
|
||||
|
||||
<set name="monster_braineater">
|
||||
<skill name="stealth" level="1"/>
|
||||
<skill name="perception" level="1"/>
|
||||
</set>
|
||||
|
||||
<set name="monster_seaserpent">
|
||||
<skill name="magic" level="4"/>
|
||||
<skill name="stealth" level="2"/>
|
||||
<skill name="stamina" level="1"/>
|
||||
<skill name="perception" level="3"/>
|
||||
</set>
|
||||
|
||||
</equipment>
|
||||
|
||||
|
|
Loading…
Reference in a new issue