No A.I. update for Azulians, Crusher, Snake, Thief

master
Noah 2024-02-11 16:51:12 -08:00
parent 79a6056834
commit c77b7b0034
8 changed files with 95 additions and 72 deletions

View File

@ -22,6 +22,7 @@ build:
# Tag the category for these doodads # Tag the category for these doodads
for i in *.doodad; do\ for i in *.doodad; do\
doodad edit-doodad --tag "category=creatures" $${i};\ doodad edit-doodad --tag "category=creatures" $${i};\
doodad edit-doodad -q --option "No A.I.=bool" $${i};\
done done
cp *.doodad ../../../assets/doodads/ cp *.doodad ../../../assets/doodads/

View File

@ -5,7 +5,7 @@ var playerSpeed = color === 'blue' ? 2 : 4,
swimSpeed = playerSpeed * 0.4, swimSpeed = playerSpeed * 0.4,
aggroX = 250, // X/Y distance sensitivity from player aggroX = 250, // X/Y distance sensitivity from player
aggroY = color === 'blue' ? 100 : 200, aggroY = color === 'blue' ? 100 : 200,
jumpSpeed = color === 'blue' ? 14 : 18, jumpSpeed = color === 'blue' ? 10 : 11,
swimJumpSpeed = jumpSpeed * 0.4, swimJumpSpeed = jumpSpeed * 0.4,
animating = false, animating = false,
direction = "right", direction = "right",
@ -15,9 +15,9 @@ var playerSpeed = color === 'blue' ? 2 : 4,
if (color === 'white') { if (color === 'white') {
aggroX = 1000; aggroX = 1000;
aggroY = 400; aggroY = 400;
playerSpeed = 8; playerSpeed = 5;
swimSpeed = playerSpeed * 0.4; swimSpeed = playerSpeed * 0.4;
jumpSpeed = 20; jumpSpeed = 12;
swimJumpSpeed = jumpSpeed * 0.4; swimJumpSpeed = jumpSpeed * 0.4;
} }
@ -32,8 +32,6 @@ function setupAnimations(color) {
} }
function main() { function main() {
playerSpeed = color === 'blue' ? 2 : 4;
let swimJumpCooldownTick = 0, // minimum Game Tick before we can jump while swimming let swimJumpCooldownTick = 0, // minimum Game Tick before we can jump while swimming
swimJumpCooldown = 10; // CONFIG: delta of ticks between jumps while swimming swimJumpCooldown = 10; // CONFIG: delta of ticks between jumps while swimming
@ -47,6 +45,11 @@ function main() {
return playerControls(); return playerControls();
} }
// No A.I.?
if (Self.GetOption("No A.I.") === true) {
return;
}
// A.I. pattern: walks back and forth, turning around // A.I. pattern: walks back and forth, turning around
// when it meets resistance. // when it meets resistance.

View File

@ -9,6 +9,7 @@ build:
# Tag the category for these doodads # Tag the category for these doodads
for i in *.doodad; do\ for i in *.doodad; do\
doodad edit-doodad --tag "category=creatures" $${i};\ doodad edit-doodad --tag "category=creatures" $${i};\
doodad edit-doodad -q --option "No A.I.=bool" $${i};\
done done
cp *.doodad ../../../assets/doodads/ cp *.doodad ../../../assets/doodads/

View File

@ -17,8 +17,8 @@ let direction = "left",
fallRadius = 120, // player distance before it drops fallRadius = 120, // player distance before it drops
helmetThickness = 48, // safe solid hitbox height helmetThickness = 48, // safe solid hitbox height
fireThickness = 12, // dangerous bottom thickness fireThickness = 12, // dangerous bottom thickness
targetAltitude = Self.Position() targetAltitude = Self.Position(),
lastAltitude = targetAltitude.Y lastAltitude = targetAltitude.Y,
size = Self.Size(); size = Self.Size();
const states = { const states = {
@ -48,6 +48,11 @@ function main() {
return player(); return player();
} }
// No A.I.?
if (Self.GetOption("No A.I.") === true) {
return;
}
let hitbox = Self.Hitbox(); let hitbox = Self.Hitbox();
Events.OnCollide((e) => { Events.OnCollide((e) => {

View File

@ -10,6 +10,7 @@ build:
# Tag the category for these doodads # Tag the category for these doodads
for i in *.doodad; do\ for i in *.doodad; do\
doodad edit-doodad --tag "category=creatures" $${i};\ doodad edit-doodad --tag "category=creatures" $${i};\
doodad edit-doodad -q --option "No A.I.=bool" $${i};\
done done
cp *.doodad ../../../assets/doodads/ cp *.doodad ../../../assets/doodads/

View File

@ -34,6 +34,11 @@ function main() {
return player(); return player();
} }
// No A.I.?
if (Self.GetOption("No A.I.") === true) {
return;
}
Events.OnCollide((e) => { Events.OnCollide((e) => {
// The snake is deadly to the touch. // The snake is deadly to the touch.
if (e.Settled && e.Actor.IsPlayer() && e.InHitbox) { if (e.Settled && e.Actor.IsPlayer() && e.InHitbox) {

View File

@ -10,5 +10,6 @@ build:
doodad install-script thief.js thief.doodad doodad install-script thief.js thief.doodad
doodad edit-doodad --tag "category=creatures" thief.doodad doodad edit-doodad --tag "category=creatures" thief.doodad
doodad edit-doodad -q --option "No A.I.=bool" thief.doodad
cp *.doodad ../../../assets/doodads/ cp *.doodad ../../../assets/doodads/

View File

@ -15,6 +15,12 @@ function main() {
if (Self.IsPlayer()) { if (Self.IsPlayer()) {
return playable(); return playable();
} }
// No A.I.?
if (Self.GetOption("No A.I.") === true) {
return;
}
return ai(); return ai();
} }