diff --git a/game/engines/default/engine/DamageType.lua b/game/engines/default/engine/DamageType.lua index c6d8e0f36befd27cc56f045583beb59341b20e6e..8244475d153e34d3d4e4c208707f8d0f4637a3ec 100644 --- a/game/engines/default/engine/DamageType.lua +++ b/game/engines/default/engine/DamageType.lua @@ -51,6 +51,17 @@ function _M:newDamageType(t) t.type = t.type:upper() t.projector = t.projector or self.defaultProjector + if not t.color and type(t.text_color) == "string" then + local ts = t.text_color:toTString() + if type(ts[2]) == "table" and ts[2][1] == "color" then + if type(ts[2][2]) == "string" then + t.color = colors[ts[2][2]] + elseif type(ts[2][2]) == "string" then + t.color = {r=ts[2][2], g=ts[2][3], b=ts[2][4]} + end + end + end + table.insert(self.dam_def, t) self[t.type] = #self.dam_def end diff --git a/game/modules/tome/data/gfx/particles/ward.lua b/game/modules/tome/data/gfx/particles/ward.lua index 570619f30f655ef72e29c63fdd5a180b8f606819..f26932e998ad082ed3fdd52edfbf39b9ddc10f72 100644 --- a/game/modules/tome/data/gfx/particles/ward.lua +++ b/game/modules/tome/data/gfx/particles/ward.lua @@ -34,7 +34,7 @@ return { generator = function() local da = math.rad(rng.range(0, 360)) return { life = core.particles.ETERNAL, - size = rng.range(3,8), sizev = 0, sizea = 0, + size = rng.range(9,12), sizev = 0, sizea = 0, x = r * math.cos(a) + dr * math.cos(da), xv = 0, xa = 0, y = r * math.sin(a) + dr * math.cos(da), yv = 0, ya = 0, @@ -44,10 +44,10 @@ return { generator = function() r = color.r/255, rv = 0, ra = 0, g = color.g/255, gv = 0, ga = 0, b = color.b/255, gv = 0, ga = 0, - a = rng.range(230, 225)/255, av = 0, aa = 0, + a = rng.range(130, 165)/255, av = 0, aa = 0, } end, }, function(self) if first then self.ps:emit(10) first = false end end, -10 +10, "particles_images/shieldimg" diff --git a/game/modules/tome/data/gfx/particles_images/shieldimg.png b/game/modules/tome/data/gfx/particles_images/shieldimg.png new file mode 100644 index 0000000000000000000000000000000000000000..56049ab03095f20d860ba2eb8d05611c5bf71ee2 Binary files /dev/null and b/game/modules/tome/data/gfx/particles_images/shieldimg.png differ diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua index 5cca8e2cc5653e80e373ec81f198a720ea148f0d..bc9155dec455bfe82d828cbed5a8690fe5a9e154 100644 --- a/game/modules/tome/dialogs/Birther.lua +++ b/game/modules/tome/dialogs/Birther.lua @@ -247,6 +247,7 @@ function _M:atEnd(v) self:setTile(self.has_custom_tile.f, self.has_custom_tile.w, self.has_custom_tile.h, true) self.actor.has_custom_tile = self.has_custom_tile.f end + self:resetAttachementSpots() -- Prevent the game from auto-assigning talents if necessary. if (not config.settings.tome.autoassign_talents_on_birth) and not game.state.birth.always_learn_birth_talents then for _, d in pairs(self.descriptors) do @@ -1031,6 +1032,28 @@ function _M:fakeEquip(v) end end +function _M:resetAttachementSpots() + self.actor.attachement_spots = nil + if self.has_custom_tile then return end + + local dbr = self.birth_descriptor_def.race[self.descriptors_by_type.race or "Human"] + local dr = self.birth_descriptor_def.subrace[self.descriptors_by_type.subrace or "Cornac"] + local ds = self.birth_descriptor_def.sex[self.descriptors_by_type.sex or "Female"] + + local moddable_attachement_spots = dr.moddable_attachement_spots or dbr.moddable_attachement_spots + if moddable_attachement_spots then + local base = moddable_attachement_spots.base + local b = moddable_attachement_spots.all + if not b then b = self.actor.female and moddable_attachement_spots.female or moddable_attachement_spots.male end + local t = {} + self.actor.attachement_spots = t + for kind, d in pairs(b) do + t[kind] = {} + for o, p in pairs(d) do t[kind][o] = p / base end + end + end +end + function _M:setTile(f, w, h, last) self.actor:removeAllMOs() if not f then @@ -1045,24 +1068,10 @@ function _M:setTile(f, w, h, last) self.actor.moddable_tile = dr.copy.moddable_tile self.actor.moddable_tile_base = dr.copy.moddable_tile_base self.actor.moddable_tile_ornament = dr.copy.moddable_tile_ornament - self.actor.attachement_spots = nil - local moddable_attachement_spots = dr.moddable_attachement_spots or dbr.moddable_attachement_spots - if moddable_attachement_spots then - local base = moddable_attachement_spots.base - local b = moddable_attachement_spots.all - if not b then b = self.actor.female and moddable_attachement_spots.female or moddable_attachement_spots.male end - local t = {} - self.actor.attachement_spots = t - for kind, d in pairs(b) do - t[kind] = {} - for o, p in pairs(d) do t[kind][o] = p / base end - end - end end else self.actor.make_tile = nil self.actor.moddable_tile = nil - self.actor.attachement_spots = nil if h > w then self.actor.image = "invis.png" self.actor.add_mos = {{image=f, display_h=2, display_y=-1}} @@ -1072,6 +1081,7 @@ function _M:setTile(f, w, h, last) end self.has_custom_tile = {f=f,w=w,h=h} end + self:resetAttachementSpots() self:applyCosmeticActor()