summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-07-16 18:05:02 -0400
committerrsiddharth <s@ricketyspace.net>2019-07-16 18:05:02 -0400
commit168c1897af8f28e3eb1bea5ec1770f5fc9df0ea4 (patch)
tree1c82bf21183f415b1decdcc28c9018323860f4fa
parentd67c2f96e415e2e8ffe1edc11c76b31c13531226 (diff)
net/ricketyspace/ror/eight/orc.rkt: Add hydrar monster.
Can penetrate player's armor. Fuck.
-rw-r--r--net/ricketyspace/ror/eight/graphics/hydrar.pngbin0 -> 11654 bytes
-rw-r--r--net/ricketyspace/ror/eight/orc.rkt15
2 files changed, 11 insertions, 4 deletions
diff --git a/net/ricketyspace/ror/eight/graphics/hydrar.png b/net/ricketyspace/ror/eight/graphics/hydrar.png
new file mode 100644
index 0000000..e555bfe
--- /dev/null
+++ b/net/ricketyspace/ror/eight/graphics/hydrar.png
Binary files differ
diff --git a/net/ricketyspace/ror/eight/orc.rkt b/net/ricketyspace/ror/eight/orc.rkt
index e983942..f00d587 100644
--- a/net/ricketyspace/ror/eight/orc.rkt
+++ b/net/ricketyspace/ror/eight/orc.rkt
@@ -16,7 +16,7 @@
The Orc game is a turn-based battle game between monsters and the player.
The player encounters a room full of monsters of all kinds, including
- orcs, hydras, slimes, and brigands. They are ready to attack. It is
+ orcs, hydras, hydrars, slimes, and brigands. They are ready to attack. It is
the player's task to get rid of the monsters.
When the game starts up, it is the player's turn, meaning she is given
@@ -75,6 +75,7 @@
(struct monster (image [health #:mutable]) #:transparent)
(struct orc monster (club) #:transparent)
(struct hydra monster () #:transparent)
+(struct hydrar monster () #:transparent)
(struct slime monster (sliminess) #:transparent)
(struct brigand monster () #:transparent)
;; A Monster is a (monster Image Nat)
@@ -86,6 +87,7 @@
;; A Slime is a (slime Nat Nat Nat)
;; A Brigrand is a (brigand Nat Nat)
;; A Hydra is a (hydra Nat Nat)
+;; A Hydrar is a (hydrar Nat Nat)
;;
;; The four monster types all inherit the id and health fields from monster.
;; Two have additional attributes:
@@ -145,10 +147,11 @@
;; compute constants for image frames
(define ORC (bitmap "graphics/orc.png"))
(define HYDRA (bitmap "graphics/hydra.png"))
+(define HYDRAR (bitmap "graphics/hydrar.png"))
(define SLIME (bitmap "graphics/slime.bmp"))
(define BRIGAND (bitmap "graphics/brigand.bmp"))
-(define PIC-LIST (list ORC HYDRA SLIME BRIGAND))
+(define PIC-LIST (list ORC HYDRA HYDRAR SLIME BRIGAND))
(define w (apply max (map image-width PIC-LIST)))
(define h (apply max (map image-height PIC-LIST)))
@@ -160,6 +163,7 @@
(define ORC-IMAGE (overlay ORC FRAME))
(define HYDRA-IMAGE (overlay HYDRA FRAME))
+(define HYDRAR-IMAGE (overlay HYDRAR FRAME))
(define SLIME-IMAGE (overlay SLIME FRAME))
(define BRIGAND-IMAGE (overlay BRIGAND FRAME))
@@ -292,8 +296,9 @@
(case (random 4)
[(0) (orc ORC-IMAGE health (random+ CLUB-STRENGTH))]
[(1) (hydra HYDRA-IMAGE health)]
- [(2) (slime SLIME-IMAGE health (random+ SLIMINESS))]
- [(3) (brigand BRIGAND-IMAGE health)]
+ [(2) (hydrar HYDRAR-IMAGE health)]
+ [(3) (slime SLIME-IMAGE health (random+ SLIMINESS))]
+ [(4) (brigand BRIGAND-IMAGE health)]
[else (error "can't happen")]))
(build-list MONSTER# create-monster))
@@ -434,6 +439,8 @@
(player-health+ player (damage (random- (orc-club monster))))]
[(hydra? monster)
(player-health+ player (damage (random- (monster-health monster))))]
+ [(hydrar? monster)
+ (player-health+ player (random- (monster-health monster)))]
[(slime? monster)
(player-health+ player (damage -1))
(player-agility+ player (damage (random- (slime-sliminess monster))))]