diff --git a/enemy.ts b/enemy.ts index 7471de2..7d64074 100644 --- a/enemy.ts +++ b/enemy.ts @@ -12,11 +12,13 @@ class Enemy { protected _isAttacking: boolean = false protected _lastDirectionTick: number = 0 - constructor({ x, y, target, sprite }: { x: number, y: number, target: Pirate, sprite: Sprite }) { + constructor({ x, y, target, sprite, riches }: { x: number, y: number, target: Pirate, sprite: Sprite, riches?: number }) { this.sprite = sprite this.sprite.x = x this.sprite.y = y + this.riches = riches != null ? riches : 1 + // On initial spawn they are quick to attack! this._nextAttackTime = Math.randomRange(Militia.attackDelayMin / 2, Militia.attackDelayMax / 2) this._lastAttackTick = control.millis() diff --git a/images.g.jres b/images.g.jres index 50668c4..2b98387 100644 --- a/images.g.jres +++ b/images.g.jres @@ -44,11 +44,6 @@ "mimeType": "image/x-mkcd-f4", "displayName": "Boat Icon" }, - "image11": { - "data": "hwQIAAgAAAAAAAAA4ADu7u7d7e7u3e3u7t3u7uDd7u7gAO4OAAAAAA==", - "mimeType": "image/x-mkcd-f4", - "displayName": "Pocket Icon" - }, "image14": { "data": "hwQIAAgAAAAAVUUAUFVVBFBVVQRQVVUEUFVVBFBVVQRQVVUEAFVFAA==", "mimeType": "image/x-mkcd-f4", @@ -84,6 +79,11 @@ "mimeType": "image/x-mkcd-f4", "displayName": "Militia Broken and Broke Left" }, + "image11": { + "data": "hwQIAAgAAAAAAAAAAFAFAABRVQAQVVUEUFVVBABVRQAAQAQAAAAAAA==", + "mimeType": "image/x-mkcd-f4", + "displayName": "Pocket Icon" + }, "anim14": { "namespace": "myAnimations", "id": "anim14", diff --git a/images.g.ts b/images.g.ts index 4c15562..c54edda 100644 --- a/images.g.ts +++ b/images.g.ts @@ -296,17 +296,6 @@ e e e e e e e e . e e e e e e e . . e e e e e e . . . . . . . . -`; - case "image11": - case "Pocket Icon":return img` -. . e e e . . . -. e e e e e e . -. . d d d d . . -. . d d d d . . -. e d d e e e . -. e e e e e e . -. e e e e e e . -. e e e e e . . `; case "image14": case "Coin":return img` @@ -514,6 +503,17 @@ d d a a a c c d d . . . . . . . . . . f e e a a d d d d a . . f . . . f e e c c a a a a c d d f . . . f e e c a a a a a a d d f +`; + case "image11": + case "Pocket Icon":return img` +. . . . . . . . +. . . 1 5 . . . +. . 1 5 5 5 . . +. 5 5 5 5 5 4 . +. 5 5 5 5 5 4 . +. . 5 5 5 4 . . +. . . 4 4 . . . +. . . . . . . . `; } return null; diff --git a/island.ts b/island.ts index 6d0d298..3ce8019 100644 --- a/island.ts +++ b/island.ts @@ -209,7 +209,7 @@ namespace Island { if (player2.health > 0) livingPirates.push(player2) const randomTarget = Math.pickRandom(livingPirates) - currentEnemies.push(new Militia({ x: locX, y: locY, target: randomTarget })) + currentEnemies.push(new Militia({ x: locX, y: locY, target: randomTarget, riches: 1 + currentSegment })) }) Utils.getArrayOfLength(Math.randomRange(1, 3)).forEach(() => { diff --git a/militia.ts b/militia.ts index 4bf7821..6c92440 100644 --- a/militia.ts +++ b/militia.ts @@ -11,8 +11,8 @@ class Militia extends Enemy { static attackDelayMin: number = 4000 static attackDelayMax: number = 6000 - constructor({ x, y, target }: { x: number, y: number, target?: Pirate }) { - super({ x, y, target, sprite: sprites.create(assets.animation`Militia Walk`[0]) }) + constructor({ x, y, target, riches }: { x: number, y: number, target?: Pirate, riches?: number }) { + super({ x, y, target, sprite: sprites.create(assets.animation`Militia Walk`[0]), riches }) // Most often we spawn to the right, so walk left this.walk('left')