This commit is contained in:
2026-08-10 22:13:21 -05:00
parent 30e09a40c4
commit a8444b25ad
11 changed files with 330 additions and 155 deletions
+8
View File
@@ -0,0 +1,8 @@
// Built-in script for the `crate` archetype (see kiln-core/src/builtin_scripts.rs).
fn bump(me, dir) {
push(me.x, me.y, dir.opposite); // Try to clear our target cell
let tgt = dir.opposite.from_point(me.x, me.y);
// This will silently-nop if tgt is occupied, and it will evaluate that after the push
// (queue both right now, evaluate in that order after)
teleport(me.id, tgt.x, tgt.y);
}
+1 -1
View File
@@ -3,7 +3,7 @@
// A gem is a grabbable collectible: walking onto it (or pushing it into the
// player) fires this `grab()` hook instead of blocking. We bump the player's gem
// count and remove ourselves from the board.
fn grab(me) {
fn bump(me, _dir) {
alter_gems(1);
die();
}
+1 -1
View File
@@ -2,7 +2,7 @@
//
// A heart is a grabbable collectible: walking onto it fires `grab()` instead
// of blocking. It restores 1 health and removes itself from the board.
fn grab(me) {
fn bump(me, _dir) {
alter_health(1);
die();
}
+1 -1
View File
@@ -3,7 +3,7 @@
// A gem is a grabbable collectible: walking onto it (or pushing it into the
// player) fires this `grab()` hook instead of blocking. We bump the player's gem
// count and remove ourselves from the board.
fn grab(me) {
fn bump(me, _dir) {
let colors = [
"red",
"orange",