forked from github/server
- Kampfänderung (festen Gegener - opponent - auswählen)
- cvsignore verzeichnisse aktualisieren - igjarjuk-erscheinen deaktiviert
This commit is contained in:
parent
28021ed6a6
commit
7ef6d4e960
|
@ -1,2 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
*.plg
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
*.plg
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -420,7 +420,6 @@ select_corpse(battle * b, fighter * af)
|
||||||
continue;
|
continue;
|
||||||
if (di < dead) {
|
if (di < dead) {
|
||||||
return df;
|
return df;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
di -= dead;
|
di -= dead;
|
||||||
}
|
}
|
||||||
|
@ -1333,7 +1332,6 @@ troop
|
||||||
select_enemy(battle * b, fighter * af, int minrow, int maxrow)
|
select_enemy(battle * b, fighter * af, int minrow, int maxrow)
|
||||||
{
|
{
|
||||||
side *as = af->side;
|
side *as = af->side;
|
||||||
troop dt = no_troop;
|
|
||||||
int si;
|
int si;
|
||||||
int enemies;
|
int enemies;
|
||||||
|
|
||||||
|
@ -1348,10 +1346,10 @@ select_enemy(battle * b, fighter * af, int minrow, int maxrow)
|
||||||
enemies = count_enemies(b, as, minrow, maxrow);
|
enemies = count_enemies(b, as, minrow, maxrow);
|
||||||
|
|
||||||
/* Niemand ist in der angegebenen Entfernung? */
|
/* Niemand ist in der angegebenen Entfernung? */
|
||||||
if (enemies<=0) return dt;
|
if (enemies<=0) return no_troop;
|
||||||
|
|
||||||
enemies = rand() % enemies;
|
enemies = rand() % enemies;
|
||||||
for (si=0;!dt.fighter && as->enemies[si];++si) {
|
for (si=0;as->enemies[si];++si) {
|
||||||
side *ds = as->enemies[si];
|
side *ds = as->enemies[si];
|
||||||
void ** fi;
|
void ** fi;
|
||||||
int ui, unitrow[NUMROWS];
|
int ui, unitrow[NUMROWS];
|
||||||
|
@ -1370,15 +1368,51 @@ select_enemy(battle * b, fighter * af, int minrow, int maxrow)
|
||||||
|
|
||||||
if (dr < minrow || dr > maxrow) continue;
|
if (dr < minrow || dr > maxrow) continue;
|
||||||
if (df->alive - df->removed > enemies) {
|
if (df->alive - df->removed > enemies) {
|
||||||
|
troop dt;
|
||||||
dt.index = enemies;
|
dt.index = enemies;
|
||||||
dt.fighter = df;
|
dt.fighter = df;
|
||||||
enemies = 0;
|
return dt;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else enemies -= (df->alive - df->removed);
|
else enemies -= (df->alive - df->removed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(!enemies);
|
assert(!enemies);
|
||||||
|
return no_troop;
|
||||||
|
}
|
||||||
|
|
||||||
|
static troop
|
||||||
|
select_opponent(battle * b, troop at, int minrow, int maxrow)
|
||||||
|
{
|
||||||
|
fighter * af = at.fighter;
|
||||||
|
troop dt = af->person[at.index].opponent;
|
||||||
|
|
||||||
|
if (af->unit->race->flags & RCF_FLY) {
|
||||||
|
/* flying races ignore min- and maxrow and can attack anyone fighting
|
||||||
|
* them */
|
||||||
|
minrow = FIGHT_ROW;
|
||||||
|
maxrow = BEHIND_ROW;
|
||||||
|
}
|
||||||
|
minrow = max(minrow, FIGHT_ROW);
|
||||||
|
|
||||||
|
if (dt.fighter!=NULL && dt.index<dt.fighter->alive) {
|
||||||
|
fighter * df = dt.fighter;
|
||||||
|
int row = get_unitrow(df);
|
||||||
|
if (row>=minrow && row<=maxrow) {
|
||||||
|
troop ot = df->person[dt.index].opponent;
|
||||||
|
if (ot.fighter==NULL || ot.index>=ot.fighter->alive) {
|
||||||
|
df->person[dt.index].opponent = at;
|
||||||
|
}
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dt = select_enemy(b, at.fighter, minrow, maxrow);
|
||||||
|
if (dt.fighter!=NULL) {
|
||||||
|
fighter * df = dt.fighter;
|
||||||
|
troop ot = df->person[dt.index].opponent;
|
||||||
|
if (ot.fighter==NULL || ot.index>=ot.fighter->alive) {
|
||||||
|
df->person[dt.index].opponent = at;
|
||||||
|
}
|
||||||
|
}
|
||||||
return dt;
|
return dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1979,11 +2013,11 @@ attack(battle *b, troop ta, const att *a)
|
||||||
boolean missile = false;
|
boolean missile = false;
|
||||||
if (wp && fval(wp->type, WTF_MISSILE)) missile=true;
|
if (wp && fval(wp->type, WTF_MISSILE)) missile=true;
|
||||||
if (missile) {
|
if (missile) {
|
||||||
if (row<=BEHIND_ROW) td = select_enemy(b, af, missile_range[0], missile_range[1]);
|
if (row<=BEHIND_ROW) td = select_opponent(b, ta, missile_range[0], missile_range[1]);
|
||||||
else return;
|
else return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (row<=FIGHT_ROW) td = select_enemy(b, af, melee_range[0], melee_range[1]);
|
if (row<=FIGHT_ROW) td = select_opponent(b, ta, melee_range[0], melee_range[1]);
|
||||||
else return;
|
else return;
|
||||||
}
|
}
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
|
@ -2017,7 +2051,7 @@ attack(battle *b, troop ta, const att *a)
|
||||||
do_extra_spell(ta, a);
|
do_extra_spell(ta, a);
|
||||||
break;
|
break;
|
||||||
case AT_NATURAL:
|
case AT_NATURAL:
|
||||||
td = select_enemy(b, af, melee_range[0]-offset, melee_range[1]-offset);
|
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
if(td.fighter->person[td.index].last_action < b->turn) {
|
if(td.fighter->person[td.index].last_action < b->turn) {
|
||||||
td.fighter->person[td.index].last_action = b->turn;
|
td.fighter->person[td.index].last_action = b->turn;
|
||||||
|
@ -2032,7 +2066,7 @@ attack(battle *b, troop ta, const att *a)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AT_DRAIN_ST:
|
case AT_DRAIN_ST:
|
||||||
td = select_enemy(b, af, melee_range[0]-offset, melee_range[1]-offset);
|
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
if(td.fighter->person[td.index].last_action < b->turn) {
|
if(td.fighter->person[td.index].last_action < b->turn) {
|
||||||
td.fighter->person[td.index].last_action = b->turn;
|
td.fighter->person[td.index].last_action = b->turn;
|
||||||
|
@ -2055,7 +2089,7 @@ attack(battle *b, troop ta, const att *a)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AT_DRAIN_EXP:
|
case AT_DRAIN_EXP:
|
||||||
td = select_enemy(b, af, melee_range[0]-offset, melee_range[1]-offset);
|
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
if(td.fighter->person[td.index].last_action < b->turn) {
|
if(td.fighter->person[td.index].last_action < b->turn) {
|
||||||
td.fighter->person[td.index].last_action = b->turn;
|
td.fighter->person[td.index].last_action = b->turn;
|
||||||
|
@ -2070,7 +2104,7 @@ attack(battle *b, troop ta, const att *a)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AT_DAZZLE:
|
case AT_DAZZLE:
|
||||||
td = select_enemy(b, af, melee_range[0]-offset, melee_range[1]-offset);
|
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
if(td.fighter->person[td.index].last_action < b->turn) {
|
if(td.fighter->person[td.index].last_action < b->turn) {
|
||||||
td.fighter->person[td.index].last_action = b->turn;
|
td.fighter->person[td.index].last_action = b->turn;
|
||||||
|
@ -2085,7 +2119,7 @@ attack(battle *b, troop ta, const att *a)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AT_STRUCTURAL:
|
case AT_STRUCTURAL:
|
||||||
td = select_enemy(b, af, melee_range[0]-offset, melee_range[1]-offset);
|
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
if(ta.fighter->person[ta.index].last_action < b->turn) {
|
if(ta.fighter->person[ta.index].last_action < b->turn) {
|
||||||
ta.fighter->person[ta.index].last_action = b->turn;
|
ta.fighter->person[ta.index].last_action = b->turn;
|
||||||
|
@ -2136,7 +2170,7 @@ do_attack(fighter * af)
|
||||||
if (!enemies) break;
|
if (!enemies) break;
|
||||||
|
|
||||||
for (apr=attacks_per_round(ta); apr > 0; apr--) {
|
for (apr=attacks_per_round(ta); apr > 0; apr--) {
|
||||||
for (a = 0; a < 6; a++) {
|
for (a=0; a!=10; ++a) {
|
||||||
if (au->race->attack[a].type != AT_NONE)
|
if (au->race->attack[a].type != AT_NONE)
|
||||||
attack(b, ta, &(au->race->attack[a]));
|
attack(b, ta, &(au->race->attack[a]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,11 @@ extern "C" {
|
||||||
AR_NONE
|
AR_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct troop {
|
||||||
|
struct fighter *fighter;
|
||||||
|
int index;
|
||||||
|
} troop;
|
||||||
|
|
||||||
typedef struct fighter {
|
typedef struct fighter {
|
||||||
struct side *side;
|
struct side *side;
|
||||||
struct unit *unit; /* Die Einheit, die hier kämpft */
|
struct unit *unit; /* Die Einheit, die hier kämpft */
|
||||||
|
@ -160,6 +165,7 @@ extern "C" {
|
||||||
int last_action : 8; /* In welcher Runde haben wir zuletzt etwas getan */
|
int last_action : 8; /* In welcher Runde haben wir zuletzt etwas getan */
|
||||||
struct weapon * missile; /* missile weapon */
|
struct weapon * missile; /* missile weapon */
|
||||||
struct weapon * melee; /* melee weapon */
|
struct weapon * melee; /* melee weapon */
|
||||||
|
struct troop opponent; /* default opponent */
|
||||||
} * person;
|
} * person;
|
||||||
int flags;
|
int flags;
|
||||||
struct {
|
struct {
|
||||||
|
@ -177,11 +183,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
} fighter;
|
} fighter;
|
||||||
|
|
||||||
typedef struct troop {
|
|
||||||
struct fighter *fighter;
|
|
||||||
int index;
|
|
||||||
} troop;
|
|
||||||
|
|
||||||
|
|
||||||
/* schilde */
|
/* schilde */
|
||||||
|
|
||||||
|
|
|
@ -5351,6 +5351,7 @@ sp_baddreams(castorder *co)
|
||||||
region *r = co->rt;
|
region *r = co->rt;
|
||||||
curse * c;
|
curse * c;
|
||||||
|
|
||||||
|
return cast_level;
|
||||||
/* wirkt erst in der Folgerunde, soll mindestens eine Runde wirken,
|
/* wirkt erst in der Folgerunde, soll mindestens eine Runde wirken,
|
||||||
* also duration+2 */
|
* also duration+2 */
|
||||||
duration = (int)max(1, power/2); /* Stufe 1 macht sonst mist */
|
duration = (int)max(1, power/2); /* Stufe 1 macht sonst mist */
|
||||||
|
@ -5390,6 +5391,7 @@ sp_gooddreams(castorder *co)
|
||||||
int cast_level = co->level;
|
int cast_level = co->level;
|
||||||
double power = co->force;
|
double power = co->force;
|
||||||
|
|
||||||
|
return cast_level;
|
||||||
/* wirkt erst in der Folgerunde, soll mindestens eine Runde wirken,
|
/* wirkt erst in der Folgerunde, soll mindestens eine Runde wirken,
|
||||||
* also duration+2 */
|
* also duration+2 */
|
||||||
duration = (int)max(1, power/2); /* Stufe 1 macht sonst mist */
|
duration = (int)max(1, power/2); /* Stufe 1 macht sonst mist */
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
Debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
debug
|
Debug
|
||||||
|
Release
|
||||||
|
Profile
|
||||||
|
|
|
@ -36,9 +36,12 @@ function process(orders)
|
||||||
read_orders(orders)
|
read_orders(orders)
|
||||||
|
|
||||||
-- igjarjuk gets called:
|
-- igjarjuk gets called:
|
||||||
require("igjarjuk-call.lua")
|
-- require("igjarjuk-call.lua")
|
||||||
call_igjarjuk()
|
-- call_igjarjuk()
|
||||||
|
u = get_unit(atoi36("50ki"))
|
||||||
|
if u~=nil then
|
||||||
|
u.region:set_flag(14, true)
|
||||||
|
end
|
||||||
--
|
--
|
||||||
process_orders()
|
process_orders()
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ function call_igjarjuk()
|
||||||
|
|
||||||
-- make him a special kind of wyrm
|
-- make him a special kind of wyrm
|
||||||
wyrm.race = "skeletal_wyrm"
|
wyrm.race = "skeletal_wyrm"
|
||||||
wyrm.hp = 5000
|
wyrm.hp = 10000
|
||||||
wyrm.status = 1
|
wyrm.status = 1
|
||||||
wyrm.magic = "nomagic"
|
wyrm.magic = "nomagic"
|
||||||
wyrm:set_skill("sk_magic", 20)
|
wyrm:set_skill("sk_magic", 20)
|
||||||
|
@ -27,6 +27,7 @@ function call_igjarjuk()
|
||||||
wyrm.faction:set_policy(laoris.faction, "fight", true)
|
wyrm.faction:set_policy(laoris.faction, "fight", true)
|
||||||
wyrm.faction:set_policy(get_faction(atoi36("dpen")), "fight", true)
|
wyrm.faction:set_policy(get_faction(atoi36("dpen")), "fight", true)
|
||||||
|
|
||||||
|
laoris:add_item("wand_of_tears", -6)
|
||||||
-- inform the folks in the grave about what's up
|
-- inform the folks in the grave about what's up
|
||||||
grave = wyrm.region
|
grave = wyrm.region
|
||||||
fog:add_notice(tostring(laoris) .. " schwingt die Schwinge des Greifen. Das Auge des Dämons glüht in hellem weißen Licht, Blitze springen auf " .. tostring(wyrm) .. " über.")
|
fog:add_notice(tostring(laoris) .. " schwingt die Schwinge des Greifen. Das Auge des Dämons glüht in hellem weißen Licht, Blitze springen auf " .. tostring(wyrm) .. " über.")
|
||||||
|
|
Loading…
Reference in New Issue