Add thrall art
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								src/art/thralls/thrall_bat.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/thralls/thrall_bat.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 468 B | 
							
								
								
									
										
											BIN
										
									
								
								src/art/thralls/thrall_charm.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/thralls/thrall_charm.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 535 B | 
							
								
								
									
										
											BIN
										
									
								
								src/art/thralls/thrall_lore.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/thralls/thrall_lore.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 536 B | 
							
								
								
									
										
											BIN
										
									
								
								src/art/thralls/thrall_party.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/thralls/thrall_party.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 503 B | 
							
								
								
									
										
											BIN
										
									
								
								src/art/thralls/thrall_stare.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/thralls/thrall_stare.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 523 B | 
							
								
								
									
										
											BIN
										
									
								
								src/art/thralls/thrall_stealth.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/thralls/thrall_stealth.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 503 B | 
| @@ -1,8 +1,8 @@ | ||||
| import {Color, Point, Rect, Size} from "./engine/datatypes.ts"; | ||||
| import {D} from "./engine/public.ts"; | ||||
|  | ||||
| export const FLOOR_CELL_SIZE: Size = new Size(40, 40) | ||||
| export const CEILING_CELL_SIZE: Size = new Size(52, 52) | ||||
| export const FLOOR_CELL_SIZE: Size = new Size(48, 48) | ||||
| export const CEILING_CELL_SIZE: Size = new Size(56, 56) | ||||
| export const HEIGHT_IN_FEET = 12; | ||||
| export const CENTER = new Point(192, 192); | ||||
| export const MOULDING_SZ = new Size(1, 1); | ||||
| @@ -126,6 +126,7 @@ export class GridArt { | ||||
|  | ||||
|   drawCeiling(color: Color) { | ||||
|     D.fillRect(this.#ceilingTl, this.#ceilingBr.subtract(this.#ceilingTl), color); | ||||
|     // D.drawRect(this.#ceilingTl, this.#ceilingBr.subtract(this.#ceilingTl), FG_BOLD); | ||||
|   } | ||||
|  | ||||
|   project(z: number): Point { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import {D} from "./engine/public.ts"; | ||||
| import {Point, Size} from "./engine/datatypes.ts"; | ||||
| import {FG_BOLD, FG_TEXT} from "./colors.ts"; | ||||
| import {BG_OUTER, FG_BOLD, FG_TEXT} from "./colors.ts"; | ||||
| import {ALL_STATS} from "./datatypes.ts"; | ||||
| import {getPlayerProgress} from "./playerprogress.ts"; | ||||
| import {getHuntMode} from "./huntmode.ts"; | ||||
| @@ -14,7 +14,7 @@ export class Hud { | ||||
|   update() { } | ||||
|  | ||||
|   draw() { | ||||
|     // D.fillRect(new Point(-4, -4), this.size.add(new Size(8, 8)), BG_INSET) | ||||
|     D.fillRect(new Point(-4, -4), this.size.add(new Size(8, 8)), BG_OUTER) | ||||
|     D.drawText(getPlayerProgress().name, new Point(0, 0), FG_BOLD) | ||||
|     D.drawText(`Level ${getHuntMode().getDepth()}`, new Point(0, 16), FG_TEXT) | ||||
|     D.drawText(`Turn ${getStateManager().getTurn()}/${getStateManager().getMaxTurns()}`, new Point(0, 32), FG_TEXT) | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import {Point} from "./engine/datatypes.ts"; | ||||
| import {DrawPile} from "./drawpile.ts"; | ||||
| import {D} from "./engine/public.ts"; | ||||
| import {sprRaccoonWalking} from "./sprites.ts"; | ||||
| import {sprThrallLore} from "./sprites.ts"; | ||||
| import { | ||||
|   BG_INSET, | ||||
|   BG_WALL_OR_UNREVEALED, | ||||
| @@ -19,6 +19,7 @@ import {getCheckModal} from "./checkmodal.ts"; | ||||
| export class HuntMode { | ||||
|   map: LoadedNewMap | ||||
|   player: Point | ||||
|   faceLeft: boolean | ||||
|  | ||||
|   drawpile: DrawPile | ||||
|   frame: number | ||||
| @@ -27,6 +28,7 @@ export class HuntMode { | ||||
|   constructor(depth: number, map: LoadedNewMap) { | ||||
|     this.map = map; | ||||
|     this.player = map.entrance; | ||||
|     this.faceLeft = false | ||||
|  | ||||
|     this.drawpile = new DrawPile(); | ||||
|     this.frame = 0; | ||||
| @@ -67,7 +69,11 @@ export class HuntMode { | ||||
|   } | ||||
|  | ||||
|   movePlayerTo(newPosition: Point) { | ||||
|     let oldX = this.player.x; | ||||
|     let newX = newPosition.x; | ||||
|     this.player = newPosition; | ||||
|     if (newX < oldX) { this.faceLeft = true; } | ||||
|     if (oldX < newX) { this.faceLeft = false; } | ||||
|     this.#collectResources(); | ||||
|   } | ||||
|  | ||||
| @@ -227,10 +233,10 @@ export class HuntMode { | ||||
|     ).offset(globalOffset.negate()) | ||||
|     this.drawpile.add(this.player.y, () => { | ||||
|       D.drawSprite( | ||||
|         sprRaccoonWalking, | ||||
|         cellOffset.offset(new Point(0, 22)), | ||||
|         0, { | ||||
|           xScale: 2, | ||||
|         sprThrallLore, | ||||
|         cellOffset, | ||||
|         1, { | ||||
|           xScale: this.faceLeft ? -2 : 2, | ||||
|           yScale: 2 | ||||
|         } | ||||
|       ) | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import {getHuntMode, HuntMode, initHuntMode} from "./huntmode.ts"; | ||||
| import {generateMap} from "./mapgen.ts"; | ||||
| import {ALL_STATS, Stat} from "./datatypes.ts"; | ||||
| import {D} from "./engine/public.ts"; | ||||
| import {sprLadder, sprLock, sprRaccoonWalking, sprResourcePickup, sprStatPickup} from "./sprites.ts"; | ||||
| import {sprLadder, sprLock, sprResourcePickup, sprStatPickup} from "./sprites.ts"; | ||||
| import {GridArt} from "./gridart.ts"; | ||||
| import {getCheckModal} from "./checkmodal.ts"; | ||||
| import {Point} from "./engine/datatypes.ts"; | ||||
| @@ -136,7 +136,8 @@ export class ThrallPickup { | ||||
|  | ||||
|   drawFloor() { } | ||||
|   drawInAir(gridArt: GridArt) { | ||||
|     D.drawSprite(sprRaccoonWalking, gridArt.project(0.0), 0, { | ||||
|     let data = getThralls().get(this.thrall); | ||||
|     D.drawSprite(data.sprite, gridArt.project(0.0), 0, { | ||||
|       xScale: 2.0, | ||||
|       yScale: 2.0, | ||||
|     }) | ||||
|   | ||||
| @@ -1,36 +1,25 @@ | ||||
| import {Sprite} from "./engine/internal/sprite.ts"; | ||||
| /* | ||||
| import imgBat from "./art/characters/bat.png"; | ||||
| import imgKobold from "./art/characters/kobold.png"; | ||||
| import imgRobot from "./art/characters/robot.png"; | ||||
| import imgSnake from "./art/characters/snake.png"; | ||||
|  */ | ||||
|  | ||||
| import imgRaccoon from "./art/characters/raccoon.png"; | ||||
| import imgRaccoonWalking from "./art/characters/raccoon_walking.png"; | ||||
| import imgResourcePickup from "./art/pickups/resources.png"; | ||||
| import imgStatPickup from "./art/pickups/stats.png"; | ||||
| import imgLadder from "./art/pickups/ladder.png"; | ||||
| import imgLock from "./art/pickups/lock.png"; | ||||
| import imgDrips from "./art/tilesets/drips.png"; | ||||
| import {Point, Size} from "./engine/datatypes.ts"; | ||||
|  | ||||
| /* | ||||
| export let sprBat = new Sprite(imgBat, 64, 64, 32, 32, 1, 1, 1); | ||||
| export let sprKobold = new Sprite(imgKobold, 64, 64, 32, 32, 1, 1, 1); | ||||
| export let sprRobot = new Sprite(imgRobot, 64, 64, 32, 32, 1, 1, 1); | ||||
| export let sprSnake = new Sprite(imgSnake, 64, 64, 32, 32, 1, 1, 1); | ||||
|  */ | ||||
| import imgThrallBat from "./art/thralls/thrall_bat.png"; | ||||
| import imgThrallCharm from "./art/thralls/thrall_charm.png"; | ||||
| import imgThrallLore from "./art/thralls/thrall_lore.png"; | ||||
| import imgThrallParty from "./art/thralls/thrall_party.png"; | ||||
| import imgThrallStare from "./art/thralls/thrall_stare.png"; | ||||
| import imgThrallStealth from "./art/thralls/thrall_stealth.png"; | ||||
|  | ||||
|  | ||||
| export let sprRaccoon = new Sprite( | ||||
|   imgRaccoon, | ||||
|   new Size(64, 64), new Point(32, 32), new Size(1, 1), | ||||
|   1 | ||||
| ); | ||||
| export let sprRaccoonWalking = new Sprite( | ||||
|   imgRaccoonWalking, | ||||
|   new Size(64, 64), new Point(32, 32), new Size(8, 1), | ||||
|   8 | ||||
| ); | ||||
| export let sprResourcePickup = new Sprite( | ||||
|   imgResourcePickup, new Size(32, 32), new Point(16, 16), | ||||
|   new Size(1, 1), 1 | ||||
| @@ -41,11 +30,6 @@ export let sprStatPickup = new Sprite( | ||||
|   new Size(4, 1), 4 | ||||
| ); | ||||
|  | ||||
| export let sprDrips = new Sprite( | ||||
|   imgDrips, new Size(32, 16), new Point(16, 0), | ||||
|   new Size(2, 1), 2 | ||||
| ); | ||||
|  | ||||
| export let sprLadder = new Sprite( | ||||
|   imgLadder, new Size(16, 16), new Point(8, 8), | ||||
|   new Size(1, 1), 1 | ||||
| @@ -55,3 +39,11 @@ export let sprLock = new Sprite( | ||||
|   imgLock, new Size(16, 16), new Point(8, 8), | ||||
|   new Size(1, 1), 1 | ||||
| ); | ||||
|  | ||||
|  | ||||
| export let sprThrallBat = new Sprite(imgThrallBat, new Size(24, 24), new Point(12, 12), new Size(2, 1), 2); | ||||
| export let sprThrallCharm = new Sprite(imgThrallCharm, new Size(24, 24), new Point(12, 12), new Size(2, 1), 2); | ||||
| export let sprThrallLore = new Sprite(imgThrallLore, new Size(24, 24), new Point(12, 12), new Size(2, 1), 2); | ||||
| export let sprThrallParty = new Sprite(imgThrallParty, new Size(24, 24), new Point(12, 12), new Size(2, 1), 2); | ||||
| export let sprThrallStare = new Sprite(imgThrallStare, new Size(24, 24), new Point(12, 12), new Size(2, 1), 2); | ||||
| export let sprThrallStealth = new Sprite(imgThrallStealth, new Size(24, 24), new Point(12, 12), new Size(2, 1), 2); | ||||
|   | ||||
| @@ -13,6 +13,15 @@ import { | ||||
|   stealth0, | ||||
|   stealth1 | ||||
| } from "./skills.ts"; | ||||
| import { | ||||
|   sprThrallBat, | ||||
|   sprThrallCharm, | ||||
|   sprThrallLore, | ||||
|   sprThrallParty, | ||||
|   sprThrallStare, | ||||
|   sprThrallStealth | ||||
| } from "./sprites.ts"; | ||||
| import {Sprite} from "./engine/internal/sprite.ts"; | ||||
|  | ||||
| export type Thrall = { | ||||
|   id: number | ||||
| @@ -36,8 +45,9 @@ class ThrallsTable { | ||||
|   } | ||||
| } | ||||
| export type ThrallData = { | ||||
|   label: string | ||||
|   initialCheck: CheckData | ||||
|   label: string, | ||||
|   sprite: Sprite, | ||||
|   initialCheck: CheckData, | ||||
| } | ||||
|  | ||||
| let table = new ThrallsTable(); | ||||
| @@ -52,6 +62,7 @@ export function getThralls() { | ||||
| // or Lore) | ||||
| export let thrallParty = table.add({ | ||||
|   label: "Garrett", | ||||
|   sprite: sprThrallParty, | ||||
|   initialCheck: { | ||||
|     label: "That's Garrett. He plays poker, but he goes to the zoo to cool down after he's lost a lot of chips. His ice cream cone has melted.", | ||||
|     options: [ | ||||
| @@ -75,8 +86,9 @@ export let thrallParty = table.add({ | ||||
|  | ||||
| export let thrallLore = table.add({ | ||||
|   label: "Lupin", | ||||
|   sprite: sprThrallLore, | ||||
|   initialCheck: { | ||||
|     label: "That's Lupin. He's a Wolf Scout, but hardcore about it. He's a packleader.", | ||||
|     label: "That's Lupin. He's a Wolf Scout, but hardcore about it. I'm not sure he knows he's a raccoon.", | ||||
|     options: [ | ||||
|       { | ||||
|         skill: () => stare1, // Hypnotize | ||||
| @@ -98,6 +110,7 @@ export let thrallLore = table.add({ | ||||
|  | ||||
| export let thrallBat = table.add({ | ||||
|   label: "Monica", | ||||
|   sprite: sprThrallBat, | ||||
|   initialCheck: { | ||||
|     label: "That's Monica. You've seen her cook on TV! Looks like she's enjoying a kiwi flan.", | ||||
|     options: [ | ||||
| @@ -121,6 +134,7 @@ export let thrallBat = table.add({ | ||||
|  | ||||
| export let thrallCharm = table.add({ | ||||
|   label: "Renfield", | ||||
|   sprite: sprThrallCharm, | ||||
|   initialCheck: { | ||||
|     label: "Doesn't this guy seem a little creepy? His nametag says Renfield. Not sure you should trust him...", | ||||
|     options: [ | ||||
| @@ -144,6 +158,7 @@ export let thrallCharm = table.add({ | ||||
|  | ||||
| export let thrallStealth = table.add({ | ||||
|   label: "Narthyss", | ||||
|   sprite: sprThrallStealth, | ||||
|   initialCheck: { | ||||
|     label: "Narthyss (dragon, heiress) actually owns the club, so she probably wouldn't talk to you... Would she?", | ||||
|     options: [ | ||||
| @@ -167,6 +182,7 @@ export let thrallStealth = table.add({ | ||||
|  | ||||
| export let thrallStare = table.add({ | ||||
|   label: "Ridley", | ||||
|   sprite: sprThrallStare, | ||||
|   initialCheck: { | ||||
|     label: "Ridley is the library's catalogue system. It can give you an incorrect answer to any question. (It has a couple gears loose.)", | ||||
|     options: [ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user