-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A roguelike classic! This lets us shuffle appearances and colors for actors read in from json files. This commit also ensures that actor arrays are properly freed when the game finishes. I'm quite happy with this refactoring.
- Loading branch information
Kestrel Gregorich-Trevor
committed
Jan 19, 2024
1 parent
e82c901
commit 082c15e
Showing
12 changed files
with
241 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,64 @@ | ||
{ | ||
"flyweight": { | ||
"name": "flyweight", | ||
"lv": 1, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "yellow", | ||
"hp": 12, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 6, "accuracy": 80, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
}, | ||
"bantamweight": { | ||
"name": "bantamweight", | ||
"lv": 5, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "white", | ||
"hp": 20, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 6, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 8, "accuracy": 60, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
}, | ||
"featherweight": { | ||
"name": "featherweight", | ||
"lv": 10, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "blue", | ||
"hp": 40, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 8, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 10, "kb":1, "accuracy": 70, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
}, | ||
"lightweight": { | ||
"name": "lightweight", | ||
"lv": 15, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "magenta", | ||
"hp": 80, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 8, "kb": 1, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 10, "kb": 1, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 12, "accuracy": 60, "types": ["High"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
"shuffle": { | ||
"color": 1, | ||
"appearance": 0 | ||
}, | ||
"actors": { | ||
"flyweight": { | ||
"name": "flyweight", | ||
"lv": 1, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "yellow", | ||
"hp": 12, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 6, "accuracy": 80, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
}, | ||
"bantamweight": { | ||
"name": "bantamweight", | ||
"lv": 5, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "white", | ||
"hp": 20, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 6, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 8, "accuracy": 60, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
}, | ||
"featherweight": { | ||
"name": "featherweight", | ||
"lv": 10, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "blue", | ||
"hp": 40, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 8, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 10, "kb":1, "accuracy": 70, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
}, | ||
"lightweight": { | ||
"name": "lightweight", | ||
"lv": 15, | ||
"appearance": "boxer", | ||
"chr": "B", | ||
"color": "magenta", | ||
"hp": 80, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 8, "kb": 1, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 10, "kb": 1, "accuracy": 80, "types": ["Mid"]}, | ||
{"damage": 12, "accuracy": 60, "types": ["High"]} | ||
], | ||
"ai": { "seekdef": 3 } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
{ | ||
"Zenzi": { | ||
"name": "Zenzi", | ||
"lv": 1, | ||
"chr": "@", | ||
"color": "white", | ||
"hp": 40, | ||
"speed": 40, | ||
"unique": 1, | ||
"attacks": [ | ||
{ "damage": 6, "stun": 40, "accuracy": 70, "types": ["Low"] }, | ||
{ "damage": 8, "stun": 80, "accuracy": 95, "types": ["Mid"] }, | ||
{ "damage": 12, "stun": 160, "recovery": 80, "accuracy": 50, "kb": 1, "types": ["High"] }, | ||
{ "damage": 6, "stun": 80, "kb": 2, "accuracy": 70, "types": ["Grab"] } | ||
], | ||
"equip" : {} | ||
"shuffle": { | ||
"color": 0, | ||
"appearance": 0 | ||
}, | ||
"actors" :{ | ||
"Zenzi": { | ||
"name": "Zenzi", | ||
"lv": 1, | ||
"chr": "@", | ||
"color": "yellow", | ||
"hp": 40, | ||
"speed": 40, | ||
"unique": 1, | ||
"attacks": [ | ||
{ "damage": 6, "stun": 40, "accuracy": 70, "types": ["Low"] }, | ||
{ "damage": 8, "stun": 80, "accuracy": 95, "types": ["Mid"] }, | ||
{ "damage": 12, "stun": 160, "recovery": 80, "accuracy": 50, "kb": 1, "types": ["High"] }, | ||
{ "damage": 6, "stun": 80, "kb": 2, "accuracy": 70, "types": ["Grab"] } | ||
], | ||
"equip" : {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
{ | ||
"sandbag": { | ||
"name": "sandbag", | ||
"lv": 0, | ||
"appearance": "punching bag", | ||
"chr": "S", | ||
"color": "blue", | ||
"hp": 100, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 6, "accuracy": 0, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 10 } | ||
"shuffle": { | ||
"color": 0, | ||
"appearance": 0 | ||
}, | ||
"actors": { | ||
"sandbag": { | ||
"name": "sandbag", | ||
"lv": 0, | ||
"appearance": "punching bag", | ||
"chr": "S", | ||
"color": "blue", | ||
"hp": 100, | ||
"speed": 40, | ||
"attacks": [ | ||
{"damage": 6, "accuracy": 0, "types": ["Mid"]} | ||
], | ||
"ai": { "seekdef": 10 } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
{ | ||
"flunky": { | ||
"name": "flunky", | ||
"lv": 1, | ||
"appearance": "exhausted employee", | ||
"chr": "@", | ||
"color": "green", | ||
"hp": 12, | ||
"speed": 40, | ||
"attacks": [ | ||
{ "damage": 4, "accuracy": 30, "types": ["Low"] } | ||
], | ||
"ai": { | ||
"seekdef": 5 | ||
}, | ||
"equip": {} | ||
"shuffle": { | ||
"color": 1, | ||
"appearance": 0 | ||
}, | ||
"actors": { | ||
"flunky": { | ||
"name": "flunky", | ||
"lv": 1, | ||
"appearance": "exhausted employee", | ||
"chr": "@", | ||
"color": "green", | ||
"hp": 12, | ||
"speed": 40, | ||
"attacks": [ | ||
{ "damage": 4, "accuracy": 30, "types": ["Low"] } | ||
], | ||
"ai": { | ||
"seekdef": 5 | ||
}, | ||
"equip": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
{ | ||
"knife": { | ||
"name": "combat knife", | ||
"lv": 0, | ||
"appearance": "knife", | ||
"chr": "/", | ||
"color": "white", | ||
"hp": 4, | ||
"speed": 50, | ||
"attacks": [ | ||
{ "damage": 5, "kb": 0, "accuracy": 70, "types": ["Mid"] } | ||
], | ||
"item": { | ||
"pref_slot": "weapon" | ||
}, | ||
"description": "A combat knife. Standard issue for somebody." | ||
"shuffle": { | ||
"color": 0, | ||
"appearance": 0 | ||
}, | ||
"pipe": { | ||
"name": "lead pipe", | ||
"lv": 0, | ||
"appearance": "pipe", | ||
"chr": "/", | ||
"color": "cyan", | ||
"hp": 10, | ||
"speed": 100, | ||
"attacks": [ | ||
{ "damage": 12, "kb": 1, "accuracy": 80, "types": ["High"] } | ||
], | ||
"item": { | ||
"pref_slot": "weapon" | ||
"actors": { | ||
"knife": { | ||
"name": "combat knife", | ||
"lv": 0, | ||
"appearance": "knife", | ||
"chr": "/", | ||
"color": "white", | ||
"hp": 4, | ||
"speed": 50, | ||
"attacks": [ | ||
{ "damage": 5, "kb": 0, "accuracy": 70, "types": ["Mid"] } | ||
], | ||
"item": { | ||
"pref_slot": "weapon" | ||
}, | ||
"description": "A combat knife. Standard issue for somebody." | ||
}, | ||
"description": "A trusty pipe. Polaris really shouldn't leave these lying around." | ||
"pipe": { | ||
"name": "lead pipe", | ||
"lv": 0, | ||
"appearance": "pipe", | ||
"chr": "/", | ||
"color": "cyan", | ||
"hp": 10, | ||
"speed": 100, | ||
"attacks": [ | ||
{ "damage": 12, "kb": 1, "accuracy": 80, "types": ["High"] } | ||
], | ||
"item": { | ||
"pref_slot": "weapon" | ||
}, | ||
"description": "A trusty pipe. Polaris really shouldn't leave these lying around." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.