forked from github/server
spawning of new braineaters moved into a separate LUA function which is not called for wdw.
This commit is contained in:
parent
a72a43c384
commit
9f97148163
|
@ -137,17 +137,15 @@ all_in_range(const region *r, short n, boolean (*valid)(const region *))
|
|||
}
|
||||
|
||||
void
|
||||
random_in_teleport_plane(void)
|
||||
spawn_braineaters(float chance)
|
||||
{
|
||||
region *r;
|
||||
faction *f0 = findfaction(MONSTER_FACTION);
|
||||
int next = rand() % 100;
|
||||
|
||||
int next = rand() % (int)(chance*100);
|
||||
|
||||
if (f0==NULL) return;
|
||||
|
||||
/* Für WDW abschaltbar machen */
|
||||
#if NO_RANDOM_BRAINEATERS == 0
|
||||
for (r=regions; r; r=r->next) {
|
||||
for (r = regions; r; r = r->next) {
|
||||
if (rplane(r) != get_astralplane() || rterrain(r) != T_ASTRAL) continue;
|
||||
|
||||
/* Neues Monster ? */
|
||||
|
@ -158,10 +156,9 @@ random_in_teleport_plane(void)
|
|||
set_string(&u->display, "Wabernde grüne Schwaden treiben durch den Nebel und verdichten sich zu einer unheimlichen Kreatur, die nur aus einem langen Ruderschwanz und einem riesigen runden Maul zu bestehen scheint.");
|
||||
set_level(u, SK_STEALTH, 1);
|
||||
set_level(u, SK_OBSERVATION, 1);
|
||||
next = rand() % 100;
|
||||
next = rand() % (int)(chance*100);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
plane *
|
||||
|
@ -189,7 +186,6 @@ void
|
|||
create_teleport_plane(void)
|
||||
{
|
||||
region *r;
|
||||
int i;
|
||||
plane * aplane = get_astralplane();
|
||||
|
||||
/* Regionsbereich aufbauen. */
|
||||
|
@ -217,10 +213,6 @@ create_teleport_plane(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<4;i++) {
|
||||
random_in_teleport_plane();
|
||||
}
|
||||
}
|
||||
|
||||
boolean
|
||||
|
|
|
@ -28,6 +28,7 @@ extern "C" {
|
|||
|
||||
void create_teleport_plane(void);
|
||||
void set_teleport_plane_regiontypes(void);
|
||||
void spawn_braineaters(float chance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -56,6 +56,3 @@
|
|||
#define WDW_PHOENIX
|
||||
#define WDW_PYRAMIDSPELL
|
||||
/* #define WDW_PYRAMID 1 */
|
||||
|
||||
#define KEEP_UNZIPPED 1
|
||||
#define NO_RANDOM_BRAINEATERS 1
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <kernel/race.h>
|
||||
#include <kernel/reports.h>
|
||||
#include <kernel/save.h>
|
||||
#include <kernel/teleport.h>
|
||||
#include <kernel/unit.h>
|
||||
|
||||
// lua includes
|
||||
|
@ -234,6 +235,7 @@ bind_eressea(lua_State * L)
|
|||
|
||||
/* scripted monsters */
|
||||
def("plan_monsters", &lua_planmonsters),
|
||||
def("spawn_braineaters", &spawn_braineaters),
|
||||
def("set_brain", &race_setscript),
|
||||
|
||||
/* map making */
|
||||
|
|
|
@ -35,6 +35,7 @@ function process(orders)
|
|||
-- run the turn:
|
||||
read_orders(orders)
|
||||
|
||||
spawn_braineaters(0.25)
|
||||
plan_monsters()
|
||||
process_orders()
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ function process(orders)
|
|||
end
|
||||
run_scripts()
|
||||
|
||||
spawn_braineaters(0.25)
|
||||
plan_monsters()
|
||||
process_orders()
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ function process(orders)
|
|||
read_orders(orders)
|
||||
run_scripts()
|
||||
|
||||
spawn_braineaters(0.25)
|
||||
plan_monsters()
|
||||
process_orders()
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ function process(orders)
|
|||
read_orders(orders)
|
||||
run_scripts()
|
||||
|
||||
spawn_braineaters(0.25)
|
||||
plan_monsters()
|
||||
process_orders()
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ function process(orders)
|
|||
sphinx_weekly()
|
||||
|
||||
-- run the turn:
|
||||
-- (no more braineaters) spawn_braineaters(0.25)
|
||||
plan_monsters()
|
||||
process_orders()
|
||||
outfile = "" .. get_turn()
|
||||
|
|
Loading…
Reference in New Issue