commit 99aa5481c69dac33c1b9db3510c234da436ae1da Author: JustAnyone Date: Sun Feb 8 13:41:13 2026 +0200 Initial commit diff --git a/file.mp3 b/file.mp3 new file mode 100644 index 0000000..317c08f Binary files /dev/null and b/file.mp3 differ diff --git a/json.json b/json.json new file mode 100644 index 0000000..02b6990 --- /dev/null +++ b/json.json @@ -0,0 +1,44 @@ +[ + { + "id": "bluepickle.plugin.meme.song", + "type": "sound", + "file": "file.mp3", + "volume": 1.0 + }, + { + "id": "bluepickle.plugin.meme.lights", + "type": "animation", + "frames": [{"x": 0, "y": 901, "w": 5, "h": 6, "handle x": 1, "handle y": 1, "offset x": 2048, "offset y": 1024}], + "light": true, + "light switching": true + }, + { + "id": "bluepickle.plugin.meme.building00", + "type": "award", + "min version": 1906, + "title": "A Normal House", + "text": "House big enough for a small party.", + "influence culture": 25, + "influence religion": 7, + "needs road": false, + "price": 1500, + "monthly price": 0, + "ordinal": -1, + "water": 0, + "power": 0, + "width": 1, + "height": 1, + "level": 1, + "people": 6, + "require privileges": true, // for influences + "frames": [{"bmp": "smolhouse.png"}], + "max count": 1, + "requirements": [ + {"type": "HABITANT_COUNT", "data": {"count": 1}} + ], + "animation": [ + {"id": "bluepickle.plugin.meme.lights", "x": 20, "y": -1} + ], + "script": "lua.lua" + } +] diff --git a/lua.lua b/lua.lua new file mode 100644 index 0000000..1e3a7d4 --- /dev/null +++ b/lua.lua @@ -0,0 +1,50 @@ +--[[ + Update 1.9.06 should implement City.playSound function which would allow for location based sound. + In addition, it would solve the issues with leaveCity() and leaveStage() events. +]] + +local red,green,blue, bx, by, buildingDraft, songDraft + +function script:init() + buildingDraft = Draft.getDraft("bluepickle.plugin.meme.building00") + songDraft = Draft.getDraft("bluepickle.plugin.meme.song") +end + +function script:update() + math.randomseed(os.time()*10) + red = 256 - math.random(0,256) + green = 256 - math.random(0,256) + blue = 256 - math.random(0,256) +end + +function script:draw(tileX,tileY) + if Tile.isBuildingInConstruction(tileX, tileY) then return end + Drawing.setColor(red,green,blue) + Drawing.setTile(tileX,tileY,20,-1) + Drawing.drawImage(Draft.getDraft('bluepickle.plugin.meme.lights'):getFrame(1)) + Drawing.reset() +end + +function script:event(x,y,level,event) + if event == Script.EVENT_REMOVE and Tile.getBuildingDraft(x,y):getId() == buildingDraft:getId() and song then + song.stop() + bx, by = nil + song = nil + end +end + +function script:nextDay() + if City.countBuildings(buildingDraft) > 0 then + bx, by = City.getBuilding(1, buildingDraft) + if song then + song.setPosition(bx, by) + end + end + + if bx and not song then + song = City.playSound(songDraft, bx, by, 0.5, true) + elseif song and not true then + song.stop() + song = nil + end +end diff --git a/plugin.manifest b/plugin.manifest new file mode 100644 index 0000000..47cad56 --- /dev/null +++ b/plugin.manifest @@ -0,0 +1,8 @@ +{ + "id": "svetikas.lt/theotown/party-house/manifest", + "version": 7, + "title": "Party House", + "text": "A plugin which adds a party house award with a musical surprise.", + "author": "JustAnyone", + "thumbnail": "thumbnail.png" +} diff --git a/smolhouse.png b/smolhouse.png new file mode 100644 index 0000000..021e5d0 Binary files /dev/null and b/smolhouse.png differ diff --git a/thumbnail.png b/thumbnail.png new file mode 100644 index 0000000..a7de246 Binary files /dev/null and b/thumbnail.png differ