Changed text logging so it doesn't spam in multiplayer. Set the tag of the spawned monster. Sped up the glow animation a bit.

This commit is contained in:
Kiri 2022-10-14 20:56:34 -07:00
parent 994eb66981
commit 68f110a010

View File

@ -148,17 +148,17 @@ class KiriCacodemonPlushie : HDWeapon {
goto ready;
ready:
KCPL B 0 { A_weaponready(WRF_ALL); A_WeaponBusy(false); }
KCPL B 0 { A_WeaponReady(WRF_ALL); A_WeaponBusy(false); }
// Jump to idle and skip glowing anim if we have a monster or
// spawnball out.
KCPL B 0 A_JumpIf(!(invoker.spawned_spawnball || invoker.spawned_creature), 4);
// Glowing animation.
KCPL E 5;
KCPL F 5;
KCPL G 5;
KCPL G 0 A_Jump(255, 2);
KCPL E 3;
KCPL F 3;
KCPL G 3;
KCPL G 0 A_Jump(255, 2); // Skip idle animation.
// Idle animation.
KCPL B 1;
@ -253,17 +253,21 @@ class KiriCacodemonPlushie : HDWeapon {
{
// Refuse to feed active monsters.
if(invoker.spawned_creature || invoker.spawned_spawnball) {
console.printf(
invoker.owner.A_Log(
String.format(
"Cannot feed blood to %s when they're not in their plushie!",
invoker.getMonsterName());
invoker.getMonsterName()),
true);
return;
}
// Refuse to feed monsters that don't need any more.
if(invoker.getMonsterHealth() == invoker.getMonsterMaxHealth()) {
console.printf(
invoker.owner.A_Log(
String.format(
"%s doesn't need any more food for now.",
invoker.getMonsterName());
invoker.getMonsterName()),
true);
return;
}
@ -453,7 +457,9 @@ class KiriCacodemonPlushie : HDWeapon {
if(spawned_creature) {
spawned_creature.A_SpawnItemEx("TeleFog");
spawned_creature.destroy();
A_PrintBold(String.format("%s has returned to the plushie.", getMonsterName()));
owner.A_Log(
String.format("%s has returned to the plushie.", getMonsterName()),
true);
}
// Adjust help text because the context changed. Now we can
@ -521,7 +527,7 @@ class KiriCacodemonPlushie : HDWeapon {
if(fainted_monster_despawn_countdown ==
KIRI_CACOPLUSHIE_FAINTED_MONSTER_COOLDOWN)
{
A_PrintBold(String.format("%s has fainted!", getMonsterName()));
owner.A_Log(String.format("%s has fainted!", getMonsterName()), true);
}
// After some number of frames, actually despawn the
@ -543,10 +549,11 @@ class KiriCacodemonPlushie : HDWeapon {
// Shields were totally broken. Extremely low chance
// to restore shields each frame.
if(frandom(0, 100) < 0.1) {
A_PrintBold(
owner.A_Log(
String.format(
"%s's shields have started charging.",
getMonsterName()));
getMonsterName()),
true);
setMonsterShield(0);
}
@ -580,10 +587,11 @@ class KiriCacodemonPlushie : HDWeapon {
// spawn.
if(invoker.getMonsterFainted())
{
A_PrintBold(
invoker.owner.A_Log(
String.format(
"%s has fainted and cannot manifest yet.",
invoker.getMonsterName()));
invoker.getMonsterName()),
true);
spawn_ball.A_SpawnItemEx("TeleFog");
@ -701,6 +709,9 @@ class KiriCacodemonPlushie : HDWeapon {
// Copy player colors over.
spawned_thing.translation = invoker.owner.translation;
// Set the name.
spawned_thing.setTag(invoker.getMonsterName());
// FIXME: Would prefer something to make the monster more
// distinct. Other attempts were made to distinguish the
// monster...
@ -743,7 +754,9 @@ class KiriCacodemonPlushie : HDWeapon {
} else {
// Tell the player we failed.
console.printf("Failed to summon %s: Not enough room.", invoker.getMonsterName());
invoker.owner.A_Log(
String.format("Failed to summon %s: Not enough room.", invoker.getMonsterName()),
true);
}
}