diff --git a/art/_ase_orig/jorge_idiot.xcf b/art/_ase_orig/jorge_idiot.xcf new file mode 100644 index 0000000..74fda9e Binary files /dev/null and b/art/_ase_orig/jorge_idiot.xcf differ diff --git a/art/npc/jorge.png b/art/npc/jorge.png new file mode 100644 index 0000000..f846edc Binary files /dev/null and b/art/npc/jorge.png differ diff --git a/art/npc/jorge_b.png b/art/npc/jorge_b.png new file mode 100644 index 0000000..cf0b407 Binary files /dev/null and b/art/npc/jorge_b.png differ diff --git a/art/npc/jorge_g.png b/art/npc/jorge_g.png new file mode 100644 index 0000000..f6af09b Binary files /dev/null and b/art/npc/jorge_g.png differ diff --git a/art/npc/jorge_r.png b/art/npc/jorge_r.png new file mode 100644 index 0000000..cefe93b Binary files /dev/null and b/art/npc/jorge_r.png differ diff --git a/art/npc/jorge_reduced.png b/art/npc/jorge_reduced.png new file mode 100644 index 0000000..7392401 Binary files /dev/null and b/art/npc/jorge_reduced.png differ diff --git a/main.lua b/main.lua index fb876d9..2d0b76a 100644 --- a/main.lua +++ b/main.lua @@ -23,6 +23,7 @@ require "level_editor/editor" love.filesystem.setRequirePath(love.filesystem.getRequirePath() .. ";libs/narrator/?.lua") narrator = require "narrator.narrator" startSignBook = require "stories.start_sign" +jorgeBook = require "stories.jorge" function love.load() globalAssetProperties = {} -- rebuilt from the filesystem (art/ + .meta) by getAllAssets diff --git a/npc.lua b/npc.lua index 8ed69ec..4df840d 100644 --- a/npc.lua +++ b/npc.lua @@ -20,3 +20,21 @@ function Sign:initialize(x, y) }, }) end + +Jorge = class("Jorge", Entity) +Jorge:include(Dialogable) + +function Jorge:initialize(x, y) + self.book = jorgeBook + self.saveClass = "jorge" + Entity.initialize(self, { + x = x, y = y, + color = "red", + collision = "unmoveable", + sprites = { + red = loadSprite("art/npc/jorge_r.png"), + green = loadSprite("art/npc/jorge_g.png"), + blue = loadSprite("art/npc/jorge_b.png"), + }, + }) +end diff --git a/room.lua b/room.lua index 5fc45d4..7a68ac5 100644 --- a/room.lua +++ b/room.lua @@ -474,6 +474,11 @@ function Room:createEntity(class, color, x, y) self:registerNpc(entity) return entity end + if class == "jorge" then + local entity = Jorge:new(x, y) + self:registerNpc(entity) + return entity + end local props = globalAssetProperties and globalAssetProperties[class] local behavior = props and props.class or "immoveable" @@ -599,12 +604,25 @@ function Room:attemptDelete(mouseX, mouseY, color) for index = #self.doors, 1, -1 do if removedEntities[self.doors[index]] then table.remove(self.doors, index) end end + -- NPCs are stamped into every collision layer, but are kept in their own + -- registry rather than in self.collideables. Remove them directly so a + -- right-click works no matter which editor colour is currently selected. + for index = #self.npcs, 1, -1 do + if self.npcs[index]:occupiesCell(cell) then table.remove(self.npcs, index) end + end self:tick() end function Room:attemptPlace(name, props, mouseX, mouseY, color) if not props or not props.sprites then return end local cell = self:getCellFromMousePos(mouseX, mouseY) + -- Jorge is one dialogable NPC with three display channels, not three + -- independently placeable color-layer entities. + if name == "jorge" then + self:createEntity(name, nil, cell.x, cell.y) + self:tick() + return + end -- "white" (or nil) means every channel; otherwise just the picked channel local colors @@ -703,7 +721,7 @@ function Room:serialize(includePlayers) end for _, npc in ipairs(self.npcs) do - table.insert(objects, { class = "npc", x = npc.x, y = npc.y }) + table.insert(objects, { class = npc.saveClass or "npc", x = npc.x, y = npc.y }) end return { objects = objects } diff --git a/stories/jorge.ink b/stories/jorge.ink new file mode 100644 index 0000000..8aad2e8 --- /dev/null +++ b/stories/jorge.ink @@ -0,0 +1,7 @@ +Jorge: I'm Jorge. I'm LGBTQ+, and I spent too long hiding that. + +* [Be kind] I'm glad you told me. + Jorge smiles. "Thank you. Being met with kindness makes this place feel safer." +* [Mistreat Jorge] That's not something I respect. + Jorge's smile fades. "You can choose cruelty, but you don't get to define me." +- -> END diff --git a/stories/jorge.lua b/stories/jorge.lua new file mode 100644 index 0000000..bf52bfc --- /dev/null +++ b/stories/jorge.lua @@ -0,0 +1 @@ +return {["constants"]={},["tree"]={["_"]={["_"]={"Jorge: I'm Jorge. I'm LGBTQ+, and I spent too long hiding that.",{["node"]={"Jorge smiles. \"Thank you. Being met with kindness makes this place feel safer.\""},["choice"]="Be kind",["text"]="I'm glad you told me."},{["node"]={"Jorge's smile fades. \"You can choose cruelty, but you don't get to define me.\""},["choice"]="Mistreat Jorge",["text"]="That's not something I respect."},{["divert"]={["path"]="END",["tunnel"]=false}}}}},["inclusions"]={},["params"]={},["version"]={["tree"]=1,["engine"]=2},["variables"]={},["lists"]={}} \ No newline at end of file