Skip to content
Snippets Groups Projects
Commit 3ff24f95 authored by dg's avatar dg
Browse files

Arena update, Ziguranth inside should not be friendly

git-svn-id: http://svn.net-core.org/repos/t-engine4@2603 51575b47-30f0-44d4-a5cc-537603b46e54
parent 75c95dc4
No related branches found
No related tags found
No related merge requests found
......@@ -455,6 +455,7 @@ function _M:generateOne(e)
if m then
local escort = m.make_escort
m.make_escort = nil
m.faction = "enemies"
local entry = self:getEntrance(e.entry)
m.arenaPower = e.power * m.level
m.arenaBonusMult = e.bonus
......
......@@ -36,6 +36,39 @@ newEntity{
lite = 2,
}
newEntity{ name = "wisp",
type = "elemental", subtype = "light",
display = "*", color=colors.YELLOW,
desc = [[A floating orb of magical energy. It shines with a radiant light. They explode upon contact.]],
combat = { dam=10, atk=5, apr=10, physspeed=1 },
blood_color = colors.YELLOW,
level_range = {1, nil},
exp_worth = 1,
max_life = 10,
body = { INVEN = 1, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
no_drops = true, open_door = false,
infravision = 20,
rarity = false,
lite = 4,
life_rating = 1, rank = 1, size_category = 1,
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { ai_move = "move_astar", talent_in = 1 },
energy = { mod = 1 },
stats = { str = 9, dex = 20, mag = 20 },
resolvers.talents{
[Talents.T_EXPLODE] = 3,
},
no_breath = 1,
blind_immune = 1,
fear_immune = 1,
rank = 2,
size_category = 1,
poison_immune = 1,
disease_immune = 1,
poison_immune = 1,
stun_immune = 1,
resolvers.sustains_at_birth(),
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "red crystal", color=colors.RED,
......
......@@ -29,7 +29,7 @@ newEntity{
can_pass = {pass_wall=1},
block_sight = false,
air_level = -20,
dig = "FLOOR",
dig = "WALL_SEE",
}
for i = 1, 5 do
newEntity{ base = "WALL_SEE", define_as = "WALL_SEE"..i, image = "terrain/granite_wall1_"..i..".png"}
......@@ -52,4 +52,9 @@ newEntity{
always_remember = true,
block_sight = true,
does_block_move = true,
air_level = -40,
on_stand = function(self, x, y, who)
local DT = engine.DamageType
local dam = DT:get(DT.PHYSICAL).projector(self, x, y, DT.PHYSICAL, 200)
end,
}
......@@ -55,39 +55,6 @@ newEntity{ define_as = "BASE_NPC_ARENA1",
resolvers.sustains_at_birth(),
}
newEntity{ name = "wisp",
type = "elemental", subtype = "light",
display = "*", color=colors.YELLOW,
desc = [[A floating orb of magical energy. It shines with a radiant light. They explode Pupon contact.]],
combat = { dam=10, atk=5, apr=10, physspeed=1 },
level_range = {1, nil},
exp_worth = 1,
max_life = 10,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
no_drops = true, open_door = false,
infravision = 20,
rarity = 1,
lite = 4,
life_rating = 1, rank = 1, size_category = 1,
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { ai_move = "move_astar", talent_in = 1 },
energy = { mod = 1 },
stats = { str = 9, dex = 20, mag = 20 },
resolvers.talents{
[Talents.T_EXPLODE] = 3,
},
no_breath = 1,
blind_immune = 1,
fear_immune = 1,
rank = 2,
size_category = 1,
poison_immune = 1,
disease_immune = 1,
poison_immune = 1,
stun_immune = 1,
resolvers.sustains_at_birth(),
}
--Minibosses
newEntity{ name = "skeletal rat",
......
......@@ -31,20 +31,23 @@ newEntity{ base = "BASE_LORE",
-- Id stuff
newEntity{ define_as = "ORB_KNOWLEDGE", name = "Orb of Knowledge",
newEntity{ define_as = "ORB_KNOWLEDGE",
power_source = {unknown=true},
unique = true, quest=true,
type = "jewelry", subtype="orb",
unided_name = "orb", no_unique_lore = true,
identified = true,
name = "Orb of Knowledge", identified = true,
display = "*", color=colors.VIOLET, image = "object/ruby.png",
encumber = 1,
desc = [[This orb was given to you by Elisa the halfling scryer, it will automatically identify normal and rare items for you and can be activated to identify all others.]],
on_drop = function(self, who)
if who == game.player then
game.logPlayer(who, "You cannot bring yourself to drop the %s", self:getName())
return true
end
end,
max_power = 1, power_regen = 1,
use_power = { name = "use the orb", power = 1,
use = function(self, who)
......@@ -58,6 +61,7 @@ newEntity{ define_as = "ORB_KNOWLEDGE", name = "Orb of Knowledge",
end
end
},
carrier = {
auto_id = 1,
},
......@@ -66,7 +70,8 @@ newEntity{ define_as = "ORB_KNOWLEDGE", name = "Orb of Knowledge",
newEntity{ define_as = "ARENA_BOOTS_DISE", name = "a pair of leather boots of disengagement",
slot = "FEET",
type = "armor", subtype="feet",
add_name = " (#ARMOR#)",
power_source = {technique=true},
add_name = " (#ARMOR#)#CHARGES#",
display = "]", color=colors.UMBER, image = resolvers.image_material("boots", "leather"),
encumber = 2,
desc = [[A pair of boots made of leather. They seem to be of exceptional quality.]],
......@@ -81,14 +86,15 @@ newEntity{ define_as = "ARENA_BOOTS_DISE", name = "a pair of leather boots of di
combat_armor = 2,
fatigue = 1,
},
max_power = 20, power_regen = 1,
use_talent = { id = Talents.T_DISENGAGE, level = 2, power = 10 },
max_power = 12, power_regen = 1,
use_talent = { id = Talents.T_DISENGAGE, level = 2, power = 12 },
}
newEntity{ define_as = "ARENA_BOOTS_PHAS", name = "a pair of leather boots of phasing",
slot = "FEET",
type = "armor", subtype="feet",
add_name = " (#ARMOR#)",
power_source = {arcane=true},
add_name = " (#ARMOR#)#CHARGES#",
display = "]", color=colors.UMBER, image = resolvers.image_material("boots", "leather"),
encumber = 2,
desc = [[A pair of boots made of leather. They seem to be of exceptional quality.]],
......@@ -117,7 +123,8 @@ newEntity{ define_as = "ARENA_BOOTS_PHAS", name = "a pair of leather boots of ph
newEntity{ define_as = "ARENA_BOOTS_RUSH", name = "a pair of leather boots of rushing",
slot = "FEET",
type = "armor", subtype="feet",
add_name = " (#ARMOR#)",
power_source = {technique=true},
add_name = " (#ARMOR#)#CHARGES#",
display = "]", color=colors.UMBER, image = resolvers.image_material("boots", "leather"),
encumber = 2,
desc = [[A pair of boots made of leather. They seem to be of exceptional quality.]],
......@@ -132,22 +139,24 @@ newEntity{ define_as = "ARENA_BOOTS_RUSH", name = "a pair of leather boots of ru
combat_armor = 2,
fatigue = 1,
},
max_power = 20, power_regen = 1,
use_talent = { id = Talents.T_RUSH, level = 2, power = 10 },
max_power = 32, power_regen = 1,
use_talent = { id = Talents.T_RUSH, level = 2, power = 32 },
}
newEntity{ define_as = "ARENA_BOW", name = "elm longbow of piercing arrows",
base = "BASE_LONGBOW",
level_range = {1, 10},
power_source = {technique=true},
require = { stat = { dex=11 }, },
rarity = 30,
add_name = " #CHARGES#",
egoed = true,
greater_ego = true,
identified = true,
cost = 0,
material_level = 1,
use_talent = { id = Talents.T_PIERCING_ARROW, level = 2, power = 10 },
max_power = 15, power_regen = 1,
max_power = 10, power_regen = 1,
combat = {
range = 8,
physspeed = 0.8,
......@@ -163,15 +172,17 @@ newEntity{ define_as = "ARENA_BOW", name = "elm longbow of piercing arrows",
newEntity{ define_as = "ARENA_SLING", name = "rough leather sling of flare",
base = "BASE_SLING",
level_range = {1, 10},
power_source = {technique=true},
require = { stat = { dex=11 }, },
add_name = " #CHARGES#",
rarity = 30,
egoed = true,
greater_ego = true,
identified = true,
cost = 0,
material_level = 1,
use_talent = { id = Talents.T_FLARE, level = 2, power = 15 },
max_power = 15, power_regen = 1,
use_talent = { id = Talents.T_FLARE, level = 3, power = 25 },
max_power = 25, power_regen = 1,
combat = {
range = 8,
physspeed = 0.8,
......
......@@ -683,6 +683,8 @@ void boot_lua(int state, bool rebooting, int argc, char *argv[])
docall(L, 0, 0);
else
lua_pop(L, 1);
create_particles_thread();
}
else if (state == 2)
{
......@@ -748,7 +750,6 @@ int main(int argc, char *argv[])
}
boot_lua(1, FALSE, argc, argv);
create_particles_thread();
// initialize engine and set up resolution and depth
Uint32 flags=SDL_INIT_VIDEO | SDL_INIT_TIMER;
......
......@@ -39,7 +39,7 @@
int MAX_THREADS = 1;
extern int nb_cpus;
static particle_thread *threads;
static particle_thread *threads = NULL;
static int textures_ref = LUA_NOREF;
static int nb_threads = 0;
static int cur_thread = 0;
......@@ -696,9 +696,9 @@ void thread_particle_init(particle_thread *pt, plist *l)
// stackDump (L);
// lua_pop(L,1);
// free((char*)ps->name_def);
// free((char*)ps->args);
// ps->name_def = ps->args = NULL;
free((char*)ps->name_def);
free((char*)ps->args);
ps->name_def = ps->args = NULL;
ps->init = TRUE;
}
......@@ -740,7 +740,7 @@ int thread_particles(void *data)
plist *prev;
plist *l;
while (TRUE)
while (pt->running)
{
// Wait for a keyframe
SDL_SemWait(pt->keyframes);
......@@ -772,6 +772,18 @@ int thread_particles(void *data)
SDL_mutexV(pt->lock);
}
// Cleanup
SDL_mutexP(pt->lock);
l = pt->list;
while (l)
{
thread_particle_die(pt, l);
l = l->next;
}
SDL_mutexV(pt->lock);
lua_close(L);
return(0);
}
......@@ -812,6 +824,20 @@ void create_particles_thread()
{
int i;
// Previous ones
if (threads)
{
for (i = 0; i < MAX_THREADS; i++)
{
threads[i].running = FALSE;
int status;
SDL_SemPost(threads[i].keyframes);
SDL_WaitThread(threads[i].thread, &status);
printf("Destroyed particle thread %d (%d)\n", i, status);
}
nb_threads = 0;
}
MAX_THREADS = nb_cpus - 1;
MAX_THREADS = (MAX_THREADS < 1) ? 1 : MAX_THREADS;
threads = calloc(MAX_THREADS, sizeof(particle_thread));
......@@ -822,10 +848,12 @@ void create_particles_thread()
SDL_Thread *thread;
particle_thread *pt = &threads[i];
pt->thread = thread;
pt->id = nb_threads++;
pt->list = NULL;
pt->lock = SDL_CreateMutex();
pt->keyframes = SDL_CreateSemaphore(0);
pt->running = TRUE;
thread = SDL_CreateThread(thread_particles, pt);
if (thread == NULL) {
......
......@@ -95,7 +95,9 @@ typedef struct s_plist plist;
struct s_particle_thread {
int id;
bool running;
lua_State *L;
SDL_Thread *thread;
SDL_mutex *lock;
SDL_sem *keyframes;
plist *list;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment