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
|
void
|
||||||
random_in_teleport_plane(void)
|
spawn_braineaters(float chance)
|
||||||
{
|
{
|
||||||
region *r;
|
region *r;
|
||||||
faction *f0 = findfaction(MONSTER_FACTION);
|
faction *f0 = findfaction(MONSTER_FACTION);
|
||||||
int next = rand() % 100;
|
int next = rand() % (int)(chance*100);
|
||||||
|
|
||||||
if (f0==NULL) return;
|
if (f0==NULL) return;
|
||||||
|
|
||||||
/* Für WDW abschaltbar machen */
|
for (r = regions; r; r = r->next) {
|
||||||
#if NO_RANDOM_BRAINEATERS == 0
|
|
||||||
for (r=regions; r; r=r->next) {
|
|
||||||
if (rplane(r) != get_astralplane() || rterrain(r) != T_ASTRAL) continue;
|
if (rplane(r) != get_astralplane() || rterrain(r) != T_ASTRAL) continue;
|
||||||
|
|
||||||
/* Neues Monster ? */
|
/* 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_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_STEALTH, 1);
|
||||||
set_level(u, SK_OBSERVATION, 1);
|
set_level(u, SK_OBSERVATION, 1);
|
||||||
next = rand() % 100;
|
next = rand() % (int)(chance*100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plane *
|
plane *
|
||||||
|
@ -189,7 +186,6 @@ void
|
||||||
create_teleport_plane(void)
|
create_teleport_plane(void)
|
||||||
{
|
{
|
||||||
region *r;
|
region *r;
|
||||||
int i;
|
|
||||||
plane * aplane = get_astralplane();
|
plane * aplane = get_astralplane();
|
||||||
|
|
||||||
/* Regionsbereich aufbauen. */
|
/* Regionsbereich aufbauen. */
|
||||||
|
@ -217,10 +213,6 @@ create_teleport_plane(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0;i<4;i++) {
|
|
||||||
random_in_teleport_plane();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
|
|
|
@ -28,6 +28,7 @@ extern "C" {
|
||||||
|
|
||||||
void create_teleport_plane(void);
|
void create_teleport_plane(void);
|
||||||
void set_teleport_plane_regiontypes(void);
|
void set_teleport_plane_regiontypes(void);
|
||||||
|
void spawn_braineaters(float chance);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,3 @@
|
||||||
#define WDW_PHOENIX
|
#define WDW_PHOENIX
|
||||||
#define WDW_PYRAMIDSPELL
|
#define WDW_PYRAMIDSPELL
|
||||||
/* #define WDW_PYRAMID 1 */
|
/* #define WDW_PYRAMID 1 */
|
||||||
|
|
||||||
#define KEEP_UNZIPPED 1
|
|
||||||
#define NO_RANDOM_BRAINEATERS 1
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <kernel/race.h>
|
#include <kernel/race.h>
|
||||||
#include <kernel/reports.h>
|
#include <kernel/reports.h>
|
||||||
#include <kernel/save.h>
|
#include <kernel/save.h>
|
||||||
|
#include <kernel/teleport.h>
|
||||||
#include <kernel/unit.h>
|
#include <kernel/unit.h>
|
||||||
|
|
||||||
// lua includes
|
// lua includes
|
||||||
|
@ -234,6 +235,7 @@ bind_eressea(lua_State * L)
|
||||||
|
|
||||||
/* scripted monsters */
|
/* scripted monsters */
|
||||||
def("plan_monsters", &lua_planmonsters),
|
def("plan_monsters", &lua_planmonsters),
|
||||||
|
def("spawn_braineaters", &spawn_braineaters),
|
||||||
def("set_brain", &race_setscript),
|
def("set_brain", &race_setscript),
|
||||||
|
|
||||||
/* map making */
|
/* map making */
|
||||||
|
|
|
@ -35,6 +35,7 @@ function process(orders)
|
||||||
-- run the turn:
|
-- run the turn:
|
||||||
read_orders(orders)
|
read_orders(orders)
|
||||||
|
|
||||||
|
spawn_braineaters(0.25)
|
||||||
plan_monsters()
|
plan_monsters()
|
||||||
process_orders()
|
process_orders()
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ function process(orders)
|
||||||
end
|
end
|
||||||
run_scripts()
|
run_scripts()
|
||||||
|
|
||||||
|
spawn_braineaters(0.25)
|
||||||
plan_monsters()
|
plan_monsters()
|
||||||
process_orders()
|
process_orders()
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ function process(orders)
|
||||||
read_orders(orders)
|
read_orders(orders)
|
||||||
run_scripts()
|
run_scripts()
|
||||||
|
|
||||||
|
spawn_braineaters(0.25)
|
||||||
plan_monsters()
|
plan_monsters()
|
||||||
process_orders()
|
process_orders()
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ function process(orders)
|
||||||
read_orders(orders)
|
read_orders(orders)
|
||||||
run_scripts()
|
run_scripts()
|
||||||
|
|
||||||
|
spawn_braineaters(0.25)
|
||||||
plan_monsters()
|
plan_monsters()
|
||||||
process_orders()
|
process_orders()
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ function process(orders)
|
||||||
sphinx_weekly()
|
sphinx_weekly()
|
||||||
|
|
||||||
-- run the turn:
|
-- run the turn:
|
||||||
|
-- (no more braineaters) spawn_braineaters(0.25)
|
||||||
plan_monsters()
|
plan_monsters()
|
||||||
process_orders()
|
process_orders()
|
||||||
outfile = "" .. get_turn()
|
outfile = "" .. get_turn()
|
||||||
|
|
Loading…
Reference in New Issue