Skip to content
Snippets Groups Projects
Commit 5b759d5d authored by dg's avatar dg
Browse files

when attacking the assasins in the special encounter they get hostile

git-svn-id: http://svn.net-core.org/repos/t-engine4@658 51575b47-30f0-44d4-a5cc-537603b46e54
parent faf2b2d6
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,11 @@ function _M:add(t)
self.factions[t.short_name] = t
end
--- Returns the faction definition
function _M:get(id)
return self.factions[id]
end
--- Returns the status of faction f1 toward f2
-- @param f1 the source faction
-- @param f2 the target faction
......
......@@ -49,6 +49,10 @@ function _M:onTakeHit(value, src)
self.ai_target.actor = src
end
if Faction:get(self.faction) and Faction:get(self.faction).hostile_on_attack then
Faction:setFactionReaction(self.faction, src.faction, -100, true)
end
return mod.class.Actor.onTakeHit(self, value, src)
end
......
......@@ -90,8 +90,8 @@ ActorStats:defineStat("Luck", "lck", 50, 1, 100, "Luck defines your character's
ActorLevel:defineMaxLevel(75)
-- Factions
Faction:add{ name="water lair", reaction={} }
Faction:add{ name="assassin lair", reaction={} }
Faction:add{ name="water lair", reaction={}, hostile_on_attack=true }
Faction:add{ name="assassin lair", reaction={}, hostile_on_attack=true }
-- Actor autolevel schemes
dofile("/data/autolevel_schemes.lua")
......
......@@ -481,7 +481,7 @@ static int sdl_surface_drawstring(lua_State *L)
int b = luaL_checknumber(L, 8);
SDL_Color color = {r,g,b};
SDL_Surface *txt = TTF_RenderUTF8_Blended(*f, str, color);
SDL_Surface *txt = TTF_RenderUTF8_Solid(*f, str, color);
if (txt)
{
sdlDrawImage(*s, txt, x, y);
......@@ -500,7 +500,7 @@ static int sdl_surface_drawstring_newsurface(lua_State *L)
int b = luaL_checknumber(L, 5);
SDL_Color color = {r,g,b};
SDL_Surface *txt = TTF_RenderUTF8_Blended(*f, str, color);
SDL_Surface *txt = TTF_RenderUTF8_Solid(*f, str, color);
if (txt)
{
SDL_Surface **s = (SDL_Surface**)lua_newuserdata(L, sizeof(SDL_Surface*));
......
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