Commit fe1d20fc91ec6fdd583f62b6aa75f0b93ffe3758
1 parent
a2e67324
update some chat stuff
Probability Travel mana cost reduced
Showing
13 changed files
with
33 additions
and
13 deletions
... | ... | @@ -434,7 +434,7 @@ end |
434 | 434 | -- @string text @playername@, @npcname@, @playerdescriptor.(.-)@ |
435 | 435 | function _M:replace(text) |
436 | 436 | local Birther = require "engine.Birther" |
437 | - text = text:noun_sub("@playername@", self.player:getName()):noun_sub("@npcname@", self.npc.getName and self.npc:getName() or _t(self.npc.name, "entity name")) | |
437 | + text = text:noun_sub("@playername@", self.player:getName()):noun_sub("@npcname@", self.npc.getName and self.npc:getName() or _t(self.npc.name, "entity name") or _t"???") | |
438 | 438 | text = text:gsub("@playerdescriptor.(.-)@", function(what) |
439 | 439 | if not self.player.descriptor then return _t"???" end |
440 | 440 | if self.player.descriptor["fake_"..what] then return _t(self.player.descriptor["fake_"..what]) end | ... | ... |
... | ... | @@ -57,7 +57,7 @@ function _M:setInscription(id, name, data, cooldown, vocal, src, bypass_max_same |
57 | 57 | src.iname = name |
58 | 58 | src.idata = data |
59 | 59 | src.replace_same = name |
60 | - local chat = Chat.new("player-inscription", {name=t.name}, self, src) | |
60 | + local chat = Chat.new("player-inscription", {name=t.name, image=t.image}, self, src) | |
61 | 61 | chat:invoke() |
62 | 62 | end |
63 | 63 | return |
... | ... | @@ -79,7 +79,7 @@ function _M:setInscription(id, name, data, cooldown, vocal, src, bypass_max_same |
79 | 79 | src.player = self |
80 | 80 | src.iname = name |
81 | 81 | src.idata = data |
82 | - local chat = Chat.new("player-inscription", {name=t.name}, self, src) | |
82 | + local chat = Chat.new("player-inscription", {name=t.name, image=t.image}, self, src) | |
83 | 83 | chat:invoke() |
84 | 84 | end |
85 | 85 | return | ... | ... |
... | ... | @@ -100,7 +100,7 @@ start_ambush = function(self, who) |
100 | 100 | end |
101 | 101 | |
102 | 102 | local Chat = require("engine.Chat") |
103 | - local chat = Chat.new("dreadfell-ambush", {name=_t"Ukruk the Fierce"}, who) | |
103 | + local chat = Chat.new("dreadfell-ambush", {name=_t"Ukruk the Fierce", image="npc/humanoid_orc_ukruk_the_fierce.png"}, who) | |
104 | 104 | chat:invoke() |
105 | 105 | end |
106 | 106 | ... | ... |
... | ... | @@ -127,7 +127,7 @@ newTalent{ |
127 | 127 | tactical = {BUFF = 2}, |
128 | 128 | on_pre_use_ai = artifice_tools_npc_select, -- NPC's automatically pick a tool |
129 | 129 | action = function(self, t) |
130 | - local chat = Chat.new("artifice", self, self, {player=self, slot=1, chat_tid=t.id, tool_ids=artifice_tool_tids}) | |
130 | + local chat = Chat.new("artifice", {}, self, {player=self, slot=1, chat_tid=t.id, tool_ids=artifice_tool_tids}) | |
131 | 131 | local d = chat:invoke() |
132 | 132 | d.key:addBinds{ EXIT = function() |
133 | 133 | game:unregisterDialog(d) | ... | ... |
... | ... | @@ -789,7 +789,7 @@ newTalent{ |
789 | 789 | return false -- NPC's don't actually use the action function |
790 | 790 | end, |
791 | 791 | action = function(self, t) |
792 | - local chat = Chat.new("trap-priming", self, self, {player=self, trapping_tids=traps_getunlocked(self, t), chat_talent=t}) | |
792 | + local chat = Chat.new("trap-priming", t, self, {player=self, trapping_tids=traps_getunlocked(self, t), chat_talent=t}) | |
793 | 793 | local d = chat:invoke() |
794 | 794 | d.key:addBinds{ EXIT = function() |
795 | 795 | self:talentDialogReturn(self.trap_primed, self.trap_primed) | ... | ... |
... | ... | @@ -178,7 +178,7 @@ newTalent{ |
178 | 178 | if self.player then -- prompt the player to pick a new element |
179 | 179 | local state = {} |
180 | 180 | local Chat = require("engine.Chat") |
181 | - local chat = Chat.new("command-staff", {name=_t"Command Staff: "..staff:getName{do_color=true, no_add_name=true}}, self, {version=staff, state=state, co=coroutine.running()}) | |
181 | + local chat = Chat.new("command-staff", staff, self, {version=staff, state=state, co=coroutine.running()}) | |
182 | 182 | local d = chat:invoke() |
183 | 183 | if not coroutine.yield() then return nil end |
184 | 184 | return true | ... | ... |
... | ... | @@ -328,7 +328,7 @@ newTalent{ |
328 | 328 | require = spells_req4, |
329 | 329 | points = 5, |
330 | 330 | cooldown = 40, |
331 | - sustain_mana = 200, | |
331 | + sustain_mana = 100, | |
332 | 332 | no_npc_use = true, |
333 | 333 | tactical = { ESCAPE = 1, CLOSEIN = 1 }, |
334 | 334 | getRange = function(self, t) return math.floor(self:combatScale(self:combatSpellpower(0.06) * self:getTalentLevel(t), 4, 0, 20, 16)) end, | ... | ... |
... | ... | @@ -678,7 +678,7 @@ newEffect{ |
678 | 678 | return |
679 | 679 | else |
680 | 680 | game._chronoworlds.see_threads_base = nil |
681 | - local chat = Chat.new("chronomancy-see-threads", {name=_t"See the Threads"}, self, {turns=eff.max_dur}) | |
681 | + local chat = Chat.new("chronomancy-see-threads", {name=_t"See the Threads", image = "talents/see_the_threads.png"}, self, {turns=eff.max_dur}) | |
682 | 682 | chat:invoke() |
683 | 683 | end |
684 | 684 | end) | ... | ... |
... | ... | @@ -63,6 +63,21 @@ function _M:getActorPortrait(actor) |
63 | 63 | -- Moddable tiles are already portrait sized |
64 | 64 | if actor.moddable_tile and Map.tiles.no_moddable_tiles then return actor end |
65 | 65 | |
66 | + -- No image at all ? | |
67 | + if not actor.image then | |
68 | + -- By any chance are we running a talent ? | |
69 | + if self.player.getCurrentTalent and self.player:getCurrentTalent() then | |
70 | + local t = self.player:getTalentFromId(self.player:getCurrentTalent()) | |
71 | + if t then | |
72 | + return Entity.new{name=t.name, image=t.image or "talents/default.png"} | |
73 | + else | |
74 | + return Entity.new{name=actor.name, image="talents/default.png"} | |
75 | + end | |
76 | + else | |
77 | + return Entity.new{name=actor.name, image="talents/default.png"} | |
78 | + end | |
79 | + end | |
80 | + | |
66 | 81 | -- No need for anything special |
67 | 82 | if actor.image:find("^portrait/") then return actor end |
68 | 83 | ... | ... |
... | ... | @@ -29,7 +29,7 @@ module(..., package.seeall, class.inherit(Base)) |
29 | 29 | function _M:init(t) |
30 | 30 | assert(t.actor, "no ChatPortrait actor") |
31 | 31 | |
32 | - self.name = t.actor.getName and t.actor:getName() or _t(t.actor.name) | |
32 | + self.name = t.actor.getName and t.actor:getName() or _t(t.actor.name) or _t"???" | |
33 | 33 | if t.actor.moddable_tile then |
34 | 34 | self.actor_frame = ActorFrame.new{actor=t.actor, w=128, h=128, allow_cb=false, allow_shader=false} |
35 | 35 | elseif t.actor.image == "invis.png" and t.actor.add_mos and t.actor.add_mos[1] and t.actor.add_mos[1].image then |
... | ... | @@ -83,7 +83,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y) |
83 | 83 | |
84 | 84 | core.display.glScissor(true, screen_x + 4, screen_y + 229, 152, 23) |
85 | 85 | -- Center if it fits, left align is not |
86 | - if self.name_tex.w <= 229 then | |
86 | + if self.name_tex.w <= 153 then | |
87 | 87 | self:textureToScreen(self.name_tex, x + 80 - self.name_tex.w / 2, y + 240 - self.name_tex.h / 2) |
88 | 88 | else |
89 | 89 | self:textureToScreen(self.name_tex, x + 4, y + 240 - self.name_tex.h / 2) | ... | ... |
... | ... | @@ -596,8 +596,13 @@ function resolvers.calc.chatfeature(t, e) |
596 | 596 | e.chat_faction = t[2] |
597 | 597 | t = t[1] |
598 | 598 | |
599 | - if e.chat_faction then | |
600 | - e.chat_display_entity = engine.Entity.new{image="faction/"..e.chat_faction..".png"} | |
599 | + if e.chat_display then | |
600 | + e.chat_display_entity = engine.Entity.new(e.chat_display) | |
601 | + if e.chat_faction and not e.chat_display_entity.image then | |
602 | + e.chat_display_entity.image = "faction/"..e.chat_faction..".png" | |
603 | + end | |
604 | + elseif e.chat_faction then | |
605 | + e.chat_display_entity = engine.Entity.new{image="faction/"..e.chat_faction..".png", name=e.name} | |
601 | 606 | end |
602 | 607 | |
603 | 608 | e.block_move = function(self, x, y, who, act, couldpass) | ... | ... |
-
Please register or login to post a comment