2015-05-19 21:54:34 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
|
|
|
|
Shadow Warrior is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-10-09 16:09:05 +00:00
|
|
|
#include "ns.h"
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
#include "names2.h"
|
|
|
|
#include "panel.h"
|
|
|
|
#include "tags.h"
|
|
|
|
#include "ai.h"
|
|
|
|
#include "pal.h"
|
|
|
|
#include "sprite.h"
|
|
|
|
#include "weapon.h"
|
2020-08-05 22:18:45 +00:00
|
|
|
#include "misc.h"
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
|
|
|
|
2021-11-28 07:40:41 +00:00
|
|
|
int Bunny_Count = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
ANIMATOR DoActorMoveJump;
|
|
|
|
ANIMATOR DoBunnyMoveJump;
|
|
|
|
ANIMATOR DoBunnyQuickJump;
|
|
|
|
|
|
|
|
DECISION BunnyBattle[] =
|
|
|
|
{
|
|
|
|
{748, InitActorMoveCloser},
|
|
|
|
{750, InitActorAlertNoise},
|
|
|
|
{760, InitActorAttackNoise},
|
|
|
|
{1024, InitActorMoveCloser}
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnyOffense[] =
|
|
|
|
{
|
|
|
|
{600, InitActorMoveCloser},
|
|
|
|
{700, InitActorAlertNoise},
|
|
|
|
{1024, InitActorMoveCloser}
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnyBroadcast[] =
|
|
|
|
{
|
|
|
|
{21, InitActorAlertNoise},
|
|
|
|
{51, InitActorAmbientNoise},
|
|
|
|
{1024, InitActorDecide}
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnySurprised[] =
|
|
|
|
{
|
|
|
|
{500, InitActorRunAway},
|
|
|
|
{701, InitActorMoveCloser},
|
|
|
|
{1024, InitActorDecide}
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnyEvasive[] =
|
|
|
|
{
|
|
|
|
{500, InitActorWanderAround},
|
|
|
|
{1020, InitActorRunAway},
|
|
|
|
{1024, InitActorAmbientNoise}
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnyLostTarget[] =
|
|
|
|
{
|
|
|
|
{900, InitActorFindPlayer},
|
|
|
|
{1024, InitActorWanderAround}
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnyCloseRange[] =
|
|
|
|
{
|
|
|
|
{1024, InitActorAttack },
|
|
|
|
// {1024, InitActorReposition }
|
|
|
|
};
|
|
|
|
|
|
|
|
DECISION BunnyWander[] =
|
|
|
|
{
|
|
|
|
{1024, InitActorReposition}
|
|
|
|
};
|
|
|
|
|
|
|
|
PERSONALITY WhiteBunnyPersonality =
|
|
|
|
{
|
|
|
|
BunnyBattle,
|
|
|
|
BunnyOffense,
|
|
|
|
BunnyBroadcast,
|
|
|
|
BunnySurprised,
|
|
|
|
BunnyEvasive,
|
|
|
|
BunnyLostTarget,
|
|
|
|
BunnyCloseRange,
|
|
|
|
BunnyCloseRange
|
|
|
|
};
|
|
|
|
|
|
|
|
PERSONALITY BunnyPersonality =
|
|
|
|
{
|
|
|
|
BunnyEvasive,
|
|
|
|
BunnyEvasive,
|
|
|
|
BunnyEvasive,
|
|
|
|
BunnyWander,
|
|
|
|
BunnyWander,
|
|
|
|
BunnyWander,
|
|
|
|
BunnyEvasive,
|
|
|
|
BunnyEvasive
|
|
|
|
};
|
|
|
|
|
|
|
|
ATTRIBUTE BunnyAttrib =
|
|
|
|
{
|
|
|
|
{100, 120, 140, 180}, // Speeds
|
|
|
|
{5, 0, -2, -4}, // Tic Adjusts
|
|
|
|
3, // MaxWeapons;
|
|
|
|
{
|
|
|
|
DIGI_BUNNYAMBIENT, 0, DIGI_BUNNYATTACK,
|
|
|
|
DIGI_BUNNYATTACK, DIGI_BUNNYDIE2, 0,
|
|
|
|
0,0,0,0
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
ATTRIBUTE WhiteBunnyAttrib =
|
|
|
|
{
|
|
|
|
{200, 220, 340, 380}, // Speeds
|
|
|
|
{5, 0, -2, -4}, // Tic Adjusts
|
|
|
|
3, // MaxWeapons;
|
|
|
|
{
|
|
|
|
DIGI_BUNNYAMBIENT, 0, DIGI_BUNNYATTACK,
|
|
|
|
DIGI_BUNNYATTACK, DIGI_BUNNYDIE2, 0,
|
|
|
|
0,0,0,0
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY RUN
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_RUN_RATE 10
|
|
|
|
|
|
|
|
ANIMATOR DoBunnyMove, NullBunny, DoActorDebris, DoBunnyGrowUp;
|
|
|
|
|
|
|
|
STATE s_BunnyRun[5][6] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R0 + 0, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[0][1]},
|
|
|
|
{BUNNY_RUN_R0 + 1, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[0][2]},
|
|
|
|
{BUNNY_RUN_R0 + 2, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[0][3]},
|
|
|
|
{BUNNY_RUN_R0 + 3, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[0][4]},
|
|
|
|
{BUNNY_RUN_R0 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyRun[0][5]},
|
|
|
|
{BUNNY_RUN_R0 + 4, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[0][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R1 + 0, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[1][1]},
|
|
|
|
{BUNNY_RUN_R1 + 1, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[1][2]},
|
|
|
|
{BUNNY_RUN_R1 + 2, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[1][3]},
|
|
|
|
{BUNNY_RUN_R1 + 3, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[1][4]},
|
|
|
|
{BUNNY_RUN_R1 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyRun[1][5]},
|
|
|
|
{BUNNY_RUN_R1 + 4, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[1][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R2 + 0, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[2][1]},
|
|
|
|
{BUNNY_RUN_R2 + 1, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[2][2]},
|
|
|
|
{BUNNY_RUN_R2 + 2, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[2][3]},
|
|
|
|
{BUNNY_RUN_R2 + 3, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[2][4]},
|
|
|
|
{BUNNY_RUN_R2 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyRun[2][5]},
|
|
|
|
{BUNNY_RUN_R2 + 4, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[2][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R3 + 0, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[3][1]},
|
|
|
|
{BUNNY_RUN_R3 + 1, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[3][2]},
|
|
|
|
{BUNNY_RUN_R3 + 2, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[3][3]},
|
|
|
|
{BUNNY_RUN_R3 + 3, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[3][4]},
|
|
|
|
{BUNNY_RUN_R3 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyRun[3][5]},
|
|
|
|
{BUNNY_RUN_R3 + 4, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[3][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R4 + 0, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[4][1]},
|
|
|
|
{BUNNY_RUN_R4 + 1, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[4][2]},
|
|
|
|
{BUNNY_RUN_R4 + 2, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[4][3]},
|
|
|
|
{BUNNY_RUN_R4 + 3, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[4][4]},
|
|
|
|
{BUNNY_RUN_R4 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyRun[4][5]},
|
|
|
|
{BUNNY_RUN_R4 + 4, BUNNY_RUN_RATE | SF_TIC_ADJUST, DoBunnyMove, &s_BunnyRun[4][0]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyRun[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnyRun[0][0],
|
|
|
|
&s_BunnyRun[1][0],
|
|
|
|
&s_BunnyRun[2][0],
|
|
|
|
&s_BunnyRun[3][0],
|
|
|
|
&s_BunnyRun[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY STAND
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_STAND_RATE 12
|
|
|
|
ANIMATOR DoBunnyEat;
|
|
|
|
|
|
|
|
STATE s_BunnyStand[5][3] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R0 + 0, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[0][1]},
|
|
|
|
{BUNNY_STAND_R0 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyStand[0][2]},
|
|
|
|
{BUNNY_STAND_R0 + 4, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[0][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R1 + 0, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[1][1]},
|
|
|
|
{BUNNY_STAND_R1 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyStand[1][2]},
|
|
|
|
{BUNNY_STAND_R1 + 4, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[1][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R2 + 0, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[2][1]},
|
|
|
|
{BUNNY_STAND_R2 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyStand[2][2]},
|
|
|
|
{BUNNY_STAND_R2 + 4, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[2][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R3 + 0, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[3][1]},
|
|
|
|
{BUNNY_STAND_R3 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyStand[3][2]},
|
|
|
|
{BUNNY_STAND_R3 + 4, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[3][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R4 + 0, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[4][1]},
|
|
|
|
{BUNNY_STAND_R4 + 4, SF_QUICK_CALL, DoBunnyGrowUp, &s_BunnyStand[4][2]},
|
|
|
|
{BUNNY_STAND_R4 + 4, BUNNY_STAND_RATE, DoBunnyEat, &s_BunnyStand[4][0]},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyStand[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
s_BunnyStand[0],
|
|
|
|
s_BunnyStand[1],
|
|
|
|
s_BunnyStand[2],
|
|
|
|
s_BunnyStand[3],
|
|
|
|
s_BunnyStand[4]
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY GET LAYED
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_SCREW_RATE 16
|
|
|
|
ANIMATOR DoBunnyScrew;
|
|
|
|
|
|
|
|
STATE s_BunnyScrew[5][2] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R0 + 0, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[0][1]},
|
|
|
|
{BUNNY_STAND_R0 + 2, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[0][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R1 + 0, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[1][1]},
|
|
|
|
{BUNNY_STAND_R1 + 2, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[1][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R2 + 0, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[2][1]},
|
|
|
|
{BUNNY_STAND_R2 + 2, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[2][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R3 + 0, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[3][1]},
|
|
|
|
{BUNNY_STAND_R3 + 2, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[3][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_STAND_R4 + 0, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[4][1]},
|
|
|
|
{BUNNY_STAND_R4 + 2, BUNNY_SCREW_RATE, DoBunnyScrew, &s_BunnyScrew[4][0]},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyScrew[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
s_BunnyScrew[0],
|
|
|
|
s_BunnyScrew[1],
|
|
|
|
s_BunnyScrew[2],
|
|
|
|
s_BunnyScrew[3],
|
|
|
|
s_BunnyScrew[4]
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY SWIPE
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_SWIPE_RATE 8
|
|
|
|
ANIMATOR InitActorDecide;
|
|
|
|
ANIMATOR InitBunnySlash;
|
|
|
|
|
|
|
|
STATE s_BunnySwipe[5][8] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[0][1]},
|
|
|
|
{BUNNY_SWIPE_R0 + 1, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[0][2]},
|
|
|
|
{BUNNY_SWIPE_R0 + 1, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[0][3]},
|
|
|
|
{BUNNY_SWIPE_R0 + 2, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[0][4]},
|
|
|
|
{BUNNY_SWIPE_R0 + 3, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[0][5]},
|
|
|
|
{BUNNY_SWIPE_R0 + 3, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[0][6]},
|
|
|
|
{BUNNY_SWIPE_R0 + 3, 0 | SF_QUICK_CALL, InitActorDecide, &s_BunnySwipe[0][7]},
|
|
|
|
{BUNNY_SWIPE_R0 + 3, BUNNY_SWIPE_RATE, DoBunnyMove, &s_BunnySwipe[0][7]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R1 + 0, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[1][1]},
|
|
|
|
{BUNNY_SWIPE_R1 + 1, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[1][2]},
|
|
|
|
{BUNNY_SWIPE_R1 + 1, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[1][3]},
|
|
|
|
{BUNNY_SWIPE_R1 + 2, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[1][4]},
|
|
|
|
{BUNNY_SWIPE_R1 + 3, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[1][5]},
|
|
|
|
{BUNNY_SWIPE_R1 + 3, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[1][6]},
|
|
|
|
{BUNNY_SWIPE_R1 + 3, 0 | SF_QUICK_CALL, InitActorDecide, &s_BunnySwipe[1][7]},
|
|
|
|
{BUNNY_SWIPE_R1 + 3, BUNNY_SWIPE_RATE, DoBunnyMove, &s_BunnySwipe[1][7]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R2 + 0, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[2][1]},
|
|
|
|
{BUNNY_SWIPE_R2 + 1, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[2][2]},
|
|
|
|
{BUNNY_SWIPE_R2 + 1, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[2][3]},
|
|
|
|
{BUNNY_SWIPE_R2 + 2, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[2][4]},
|
|
|
|
{BUNNY_SWIPE_R2 + 3, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[2][5]},
|
|
|
|
{BUNNY_SWIPE_R2 + 3, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[2][6]},
|
|
|
|
{BUNNY_SWIPE_R2 + 3, 0 | SF_QUICK_CALL, InitActorDecide, &s_BunnySwipe[2][7]},
|
|
|
|
{BUNNY_SWIPE_R2 + 3, BUNNY_SWIPE_RATE, DoBunnyMove, &s_BunnySwipe[2][7]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R3 + 0, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[3][1]},
|
|
|
|
{BUNNY_SWIPE_R3 + 1, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[3][2]},
|
|
|
|
{BUNNY_SWIPE_R3 + 1, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[3][3]},
|
|
|
|
{BUNNY_SWIPE_R3 + 2, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[3][4]},
|
|
|
|
{BUNNY_SWIPE_R3 + 3, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[3][5]},
|
|
|
|
{BUNNY_SWIPE_R3 + 3, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[3][6]},
|
|
|
|
{BUNNY_SWIPE_R3 + 3, 0 | SF_QUICK_CALL, InitActorDecide, &s_BunnySwipe[3][7]},
|
|
|
|
{BUNNY_SWIPE_R3 + 3, BUNNY_SWIPE_RATE, DoBunnyMove, &s_BunnySwipe[3][7]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R4 + 0, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[4][1]},
|
|
|
|
{BUNNY_SWIPE_R4 + 1, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[4][2]},
|
|
|
|
{BUNNY_SWIPE_R4 + 1, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[4][3]},
|
|
|
|
{BUNNY_SWIPE_R4 + 2, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[4][4]},
|
|
|
|
{BUNNY_SWIPE_R4 + 3, BUNNY_SWIPE_RATE, NullBunny, &s_BunnySwipe[4][5]},
|
|
|
|
{BUNNY_SWIPE_R4 + 3, 0 | SF_QUICK_CALL, InitBunnySlash, &s_BunnySwipe[4][6]},
|
|
|
|
{BUNNY_SWIPE_R4 + 3, 0 | SF_QUICK_CALL, InitActorDecide, &s_BunnySwipe[4][7]},
|
|
|
|
{BUNNY_SWIPE_R4 + 3, BUNNY_SWIPE_RATE, DoBunnyMove, &s_BunnySwipe[4][7]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnySwipe[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnySwipe[0][0],
|
|
|
|
&s_BunnySwipe[1][0],
|
|
|
|
&s_BunnySwipe[2][0],
|
|
|
|
&s_BunnySwipe[3][0],
|
|
|
|
&s_BunnySwipe[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY HEART - show players heart
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_HEART_RATE 14
|
|
|
|
ANIMATOR DoBunnyStandKill;
|
|
|
|
|
|
|
|
STATE s_BunnyHeart[5][4] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_HEART_RATE, DoBunnyStandKill, &s_BunnyHeart[0][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R1 + 0, BUNNY_HEART_RATE, DoBunnyStandKill, &s_BunnyHeart[1][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R2 + 0, BUNNY_HEART_RATE, DoBunnyStandKill, &s_BunnyHeart[2][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R3 + 0, BUNNY_HEART_RATE, DoBunnyStandKill, &s_BunnyHeart[3][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R4 + 0, BUNNY_HEART_RATE, DoBunnyStandKill, &s_BunnyHeart[4][0]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyHeart[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnyHeart[0][0],
|
|
|
|
&s_BunnyHeart[1][0],
|
|
|
|
&s_BunnyHeart[2][0],
|
|
|
|
&s_BunnyHeart[3][0],
|
|
|
|
&s_BunnyHeart[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY PAIN
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_PAIN_RATE 38
|
|
|
|
ANIMATOR DoBunnyPain;
|
|
|
|
|
|
|
|
STATE s_BunnyPain[5][1] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_PAIN_RATE, DoBunnyPain, &s_BunnyPain[0][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_PAIN_RATE, DoBunnyPain, &s_BunnyPain[1][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_PAIN_RATE, DoBunnyPain, &s_BunnyPain[2][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_PAIN_RATE, DoBunnyPain, &s_BunnyPain[3][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_SWIPE_R0 + 0, BUNNY_PAIN_RATE, DoBunnyPain, &s_BunnyPain[4][0]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyPain[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnyPain[0][0],
|
|
|
|
&s_BunnyPain[1][0],
|
|
|
|
&s_BunnyPain[2][0],
|
|
|
|
&s_BunnyPain[3][0],
|
|
|
|
&s_BunnyPain[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY JUMP
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_JUMP_RATE 25
|
|
|
|
|
|
|
|
STATE s_BunnyJump[5][6] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R0 + 1, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[0][1]},
|
|
|
|
{BUNNY_RUN_R0 + 2, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[0][1]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R1 + 1, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[1][1]},
|
|
|
|
{BUNNY_RUN_R1 + 2, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[1][1]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R2 + 1, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[2][1]},
|
|
|
|
{BUNNY_RUN_R2 + 2, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[2][1]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R3 + 1, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[3][1]},
|
|
|
|
{BUNNY_RUN_R3 + 2, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[3][1]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R4 + 1, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[4][1]},
|
|
|
|
{BUNNY_RUN_R4 + 2, BUNNY_JUMP_RATE, DoBunnyMoveJump, &s_BunnyJump[4][1]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyJump[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnyJump[0][0],
|
|
|
|
&s_BunnyJump[1][0],
|
|
|
|
&s_BunnyJump[2][0],
|
|
|
|
&s_BunnyJump[3][0],
|
|
|
|
&s_BunnyJump[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY FALL
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_FALL_RATE 25
|
|
|
|
|
|
|
|
STATE s_BunnyFall[5][6] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R0 + 3, BUNNY_FALL_RATE, DoBunnyMoveJump, &s_BunnyFall[0][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R1 + 3, BUNNY_FALL_RATE, DoBunnyMoveJump, &s_BunnyFall[1][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R2 + 3, BUNNY_FALL_RATE, DoBunnyMoveJump, &s_BunnyFall[2][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R3 + 3, BUNNY_FALL_RATE, DoBunnyMoveJump, &s_BunnyFall[3][0]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R4 + 3, BUNNY_FALL_RATE, DoBunnyMoveJump, &s_BunnyFall[4][0]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyFall[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnyFall[0][0],
|
|
|
|
&s_BunnyFall[1][0],
|
|
|
|
&s_BunnyFall[2][0],
|
|
|
|
&s_BunnyFall[3][0],
|
|
|
|
&s_BunnyFall[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY JUMP ATTACK
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_JUMP_ATTACK_RATE 35
|
2021-10-29 18:49:57 +00:00
|
|
|
int DoBunnyBeginJumpAttack(DSWActor* actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
STATE s_BunnyJumpAttack[5][6] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R0 + 1, BUNNY_JUMP_ATTACK_RATE, NullBunny, &s_BunnyJumpAttack[0][1]},
|
|
|
|
{BUNNY_RUN_R0 + 1, 0 | SF_QUICK_CALL, DoBunnyBeginJumpAttack, &s_BunnyJumpAttack[0][2]},
|
|
|
|
{BUNNY_RUN_R0 + 2, BUNNY_JUMP_ATTACK_RATE, DoBunnyMoveJump, &s_BunnyJumpAttack[0][2]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R1 + 1, BUNNY_JUMP_ATTACK_RATE, NullBunny, &s_BunnyJumpAttack[1][1]},
|
|
|
|
{BUNNY_RUN_R1 + 1, 0 | SF_QUICK_CALL, DoBunnyBeginJumpAttack, &s_BunnyJumpAttack[1][2]},
|
|
|
|
{BUNNY_RUN_R1 + 2, BUNNY_JUMP_ATTACK_RATE, DoBunnyMoveJump, &s_BunnyJumpAttack[1][2]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R2 + 1, BUNNY_JUMP_ATTACK_RATE, NullBunny, &s_BunnyJumpAttack[2][1]},
|
|
|
|
{BUNNY_RUN_R2 + 1, 0 | SF_QUICK_CALL, DoBunnyBeginJumpAttack, &s_BunnyJumpAttack[2][2]},
|
|
|
|
{BUNNY_RUN_R2 + 2, BUNNY_JUMP_ATTACK_RATE, DoBunnyMoveJump, &s_BunnyJumpAttack[2][2]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R3 + 1, BUNNY_JUMP_ATTACK_RATE, NullBunny, &s_BunnyJumpAttack[3][1]},
|
|
|
|
{BUNNY_RUN_R3 + 1, 0 | SF_QUICK_CALL, DoBunnyBeginJumpAttack, &s_BunnyJumpAttack[3][2]},
|
|
|
|
{BUNNY_RUN_R3 + 2, BUNNY_JUMP_ATTACK_RATE, DoBunnyMoveJump, &s_BunnyJumpAttack[3][2]},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{BUNNY_RUN_R4 + 1, BUNNY_JUMP_ATTACK_RATE, NullBunny, &s_BunnyJumpAttack[4][1]},
|
|
|
|
{BUNNY_RUN_R4 + 1, 0 | SF_QUICK_CALL, DoBunnyBeginJumpAttack, &s_BunnyJumpAttack[4][2]},
|
|
|
|
{BUNNY_RUN_R4 + 2, BUNNY_JUMP_ATTACK_RATE, DoBunnyMoveJump, &s_BunnyJumpAttack[4][2]},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyJumpAttack[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
&s_BunnyJumpAttack[0][0],
|
|
|
|
&s_BunnyJumpAttack[1][0],
|
|
|
|
&s_BunnyJumpAttack[2][0],
|
|
|
|
&s_BunnyJumpAttack[3][0],
|
|
|
|
&s_BunnyJumpAttack[4][0]
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////
|
|
|
|
//
|
|
|
|
// BUNNY DIE
|
|
|
|
//
|
|
|
|
//////////////////////
|
|
|
|
|
|
|
|
#define BUNNY_DIE_RATE 16
|
|
|
|
ANIMATOR BunnySpew;
|
|
|
|
|
|
|
|
STATE s_BunnyDie[] =
|
|
|
|
{
|
|
|
|
{BUNNY_DIE + 0, BUNNY_DIE_RATE, NullBunny, &s_BunnyDie[1]},
|
|
|
|
{BUNNY_DIE + 0, SF_QUICK_CALL, BunnySpew, &s_BunnyDie[2]},
|
|
|
|
{BUNNY_DIE + 1, BUNNY_DIE_RATE, NullBunny, &s_BunnyDie[3]},
|
|
|
|
{BUNNY_DIE + 2, BUNNY_DIE_RATE, NullBunny, &s_BunnyDie[4]},
|
|
|
|
{BUNNY_DIE + 2, BUNNY_DIE_RATE, NullBunny, &s_BunnyDie[5]},
|
|
|
|
{BUNNY_DEAD, BUNNY_DIE_RATE, DoActorDebris, &s_BunnyDie[5]},
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BUNNY_DEAD_RATE 8
|
|
|
|
|
|
|
|
STATE s_BunnyDead[] =
|
|
|
|
{
|
|
|
|
{BUNNY_DIE + 0, BUNNY_DEAD_RATE, NullAnimator, &s_BunnyDie[1]},
|
|
|
|
{BUNNY_DIE + 0, SF_QUICK_CALL, BunnySpew, &s_BunnyDie[2]},
|
|
|
|
{BUNNY_DIE + 1, BUNNY_DEAD_RATE, NullAnimator, &s_BunnyDead[3]},
|
|
|
|
{BUNNY_DIE + 2, BUNNY_DEAD_RATE, NullAnimator, &s_BunnyDead[4]},
|
|
|
|
{BUNNY_DEAD, SF_QUICK_CALL, QueueFloorBlood, &s_BunnyDead[5]},
|
|
|
|
{BUNNY_DEAD, BUNNY_DEAD_RATE, DoActorDebris, &s_BunnyDead[5]},
|
|
|
|
};
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyDie[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
s_BunnyDie
|
|
|
|
};
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyDead[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
s_BunnyDead
|
|
|
|
};
|
|
|
|
|
|
|
|
STATE s_BunnyDeathJump[] =
|
|
|
|
{
|
|
|
|
{BUNNY_DIE + 0, BUNNY_DIE_RATE, DoActorDeathMove, &s_BunnyDeathJump[0]}
|
|
|
|
};
|
|
|
|
|
|
|
|
STATE s_BunnyDeathFall[] =
|
|
|
|
{
|
|
|
|
{BUNNY_DIE + 1, BUNNY_DIE_RATE, DoActorDeathMove, &s_BunnyDeathFall[0]}
|
|
|
|
};
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyDeathJump[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
s_BunnyDeathJump
|
|
|
|
};
|
|
|
|
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* sg_BunnyDeathFall[] =
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
s_BunnyDeathFall
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2021-12-31 15:00:14 +00:00
|
|
|
STATE* *Stand[MAX_WEAPONS];
|
|
|
|
STATE* *Run;
|
|
|
|
STATE* *Jump;
|
|
|
|
STATE* *Fall;
|
|
|
|
STATE* *Crawl;
|
|
|
|
STATE* *Swim;
|
|
|
|
STATE* *Fly;
|
|
|
|
STATE* *Rise;
|
|
|
|
STATE* *Sit;
|
|
|
|
STATE* *Look;
|
|
|
|
STATE* *Climb;
|
|
|
|
STATE* *Pain;
|
|
|
|
STATE* *Death1;
|
|
|
|
STATE* *Death2;
|
|
|
|
STATE* *Dead;
|
|
|
|
STATE* *DeathJump;
|
|
|
|
STATE* *DeathFall;
|
|
|
|
STATE* *CloseAttack[2];
|
|
|
|
STATE* *Attack[6];
|
|
|
|
STATE* *Special[2];
|
2015-05-19 21:54:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
ACTOR_ACTION_SET BunnyActionSet =
|
|
|
|
{
|
|
|
|
sg_BunnyStand,
|
|
|
|
sg_BunnyRun,
|
|
|
|
sg_BunnyJump,
|
|
|
|
sg_BunnyFall,
|
2021-07-10 12:25:18 +00:00
|
|
|
nullptr, // sg_BunnyCrawl,
|
|
|
|
nullptr, // sg_BunnySwim,
|
|
|
|
nullptr, // sg_BunnyFly,
|
|
|
|
nullptr, // sg_BunnyRise,
|
|
|
|
nullptr, // sg_BunnySit,
|
|
|
|
nullptr, // sg_BunnyLook,
|
|
|
|
nullptr, // climb
|
2015-05-19 21:54:34 +00:00
|
|
|
sg_BunnyPain,
|
|
|
|
sg_BunnyDie,
|
2021-07-10 12:25:18 +00:00
|
|
|
nullptr,
|
2015-05-19 21:54:34 +00:00
|
|
|
sg_BunnyDead,
|
|
|
|
sg_BunnyDeathJump,
|
|
|
|
sg_BunnyDeathFall,
|
2021-07-10 12:25:18 +00:00
|
|
|
{nullptr},
|
2015-05-19 21:54:34 +00:00
|
|
|
{1024},
|
2021-07-10 12:25:18 +00:00
|
|
|
{nullptr},
|
2015-05-19 21:54:34 +00:00
|
|
|
{1024},
|
|
|
|
{sg_BunnyHeart, sg_BunnyRun},
|
2021-07-10 12:25:18 +00:00
|
|
|
nullptr,
|
|
|
|
nullptr
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ACTOR_ACTION_SET BunnyWhiteActionSet =
|
|
|
|
{
|
|
|
|
sg_BunnyStand,
|
|
|
|
sg_BunnyRun,
|
|
|
|
sg_BunnyJump,
|
|
|
|
sg_BunnyFall,
|
2021-07-10 12:25:18 +00:00
|
|
|
nullptr, // sg_BunnyCrawl,
|
|
|
|
nullptr, // sg_BunnySwim,
|
|
|
|
nullptr, // sg_BunnyFly,
|
|
|
|
nullptr, // sg_BunnyRise,
|
|
|
|
nullptr, // sg_BunnySit,
|
|
|
|
nullptr, // sg_BunnyLook,
|
|
|
|
nullptr, // climb
|
2015-05-19 21:54:34 +00:00
|
|
|
sg_BunnyPain, // pain
|
|
|
|
sg_BunnyDie,
|
2021-07-10 12:25:18 +00:00
|
|
|
nullptr,
|
2015-05-19 21:54:34 +00:00
|
|
|
sg_BunnyDead,
|
|
|
|
sg_BunnyDeathJump,
|
|
|
|
sg_BunnyDeathFall,
|
|
|
|
{sg_BunnySwipe},
|
|
|
|
{1024},
|
|
|
|
// {sg_BunnyJumpAttack, sg_BunnySwipe},
|
|
|
|
// {800, 1024},
|
|
|
|
{sg_BunnySwipe},
|
|
|
|
{1024},
|
|
|
|
{sg_BunnyHeart, sg_BunnySwipe},
|
2021-07-10 12:25:18 +00:00
|
|
|
nullptr,
|
|
|
|
nullptr
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int SetupBunny(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
ANIMATOR DoActorDecide;
|
|
|
|
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:54:31 +00:00
|
|
|
SpawnUser(actor, BUNNY_RUN_R0, s_BunnyRun[0]);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Health = 10;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Bunny_Count++;
|
|
|
|
|
2021-10-30 18:11:31 +00:00
|
|
|
ChangeState(actor, s_BunnyRun[0]);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.StateEnd = s_BunnyDie;
|
|
|
|
actor->user.Rot = sg_BunnyRun;
|
|
|
|
actor->user.ShellNum = 0; // Not Pregnant right now
|
|
|
|
actor->user.FlagOwner = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-24 12:21:49 +00:00
|
|
|
actor->spr.clipdist = (150) >> 2;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-24 12:21:49 +00:00
|
|
|
if (actor->spr.pal == PALETTE_PLAYER1)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-31 20:17:31 +00:00
|
|
|
EnemyDefaults(actor, &BunnyWhiteActionSet, &WhiteBunnyPersonality);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Attrib = &WhiteBunnyAttrib;
|
2021-12-24 12:21:49 +00:00
|
|
|
actor->spr.xrepeat = 96;
|
|
|
|
actor->spr.yrepeat = 90;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-24 12:21:49 +00:00
|
|
|
actor->spr.clipdist = 200>>2;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Health = 60;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
2021-12-24 12:21:49 +00:00
|
|
|
else if (actor->spr.pal == PALETTE_PLAYER8) // Male Rabbit
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-31 20:17:31 +00:00
|
|
|
EnemyDefaults(actor, &BunnyActionSet, &BunnyPersonality);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Attrib = &BunnyAttrib;
|
2021-12-24 12:21:49 +00:00
|
|
|
//actor->spr.xrepeat = 76;
|
|
|
|
//actor->spr.yrepeat = 70;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-24 12:21:49 +00:00
|
|
|
//actor->spr.shade = 0; // darker
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Health = 20;
|
|
|
|
actor->user.Flag1 = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Female Rabbit
|
2021-10-31 20:17:31 +00:00
|
|
|
EnemyDefaults(actor, &BunnyActionSet, &BunnyPersonality);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Attrib = &BunnyAttrib;
|
|
|
|
actor->user.spal = actor->spr.pal = PALETTE_PLAYER0;
|
|
|
|
actor->user.Flag1 = SEC(5);
|
2021-12-24 12:21:49 +00:00
|
|
|
//actor->spr.shade = 0; // darker
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-10-30 10:09:34 +00:00
|
|
|
DoActorSetSpeed(actor, FAST_SPEED);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 16:13:47 +00:00
|
|
|
actor->user.Flags |= (SPR_XFLIP_TOGGLE);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
|
2022-08-20 22:01:00 +00:00
|
|
|
actor->user.zclip = (16);
|
2022-08-20 21:35:05 +00:00
|
|
|
actor->user.floor_dist = (8);
|
|
|
|
actor->user.ceiling_dist = (8);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.lo_step = Z(16);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int GetBunnyJumpHeight(int jump_speed, int jump_grav)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
int jump_iterations;
|
|
|
|
int height;
|
|
|
|
|
2021-05-12 00:02:26 +00:00
|
|
|
jump_speed = abs(jump_speed);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
jump_iterations = jump_speed / (jump_grav * ACTORMOVETICS);
|
|
|
|
|
|
|
|
height = jump_speed * jump_iterations * ACTORMOVETICS;
|
|
|
|
|
2021-11-19 20:47:04 +00:00
|
|
|
return height >> 9;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int PickBunnyJumpSpeed(DSWActor* actor, int pix_height)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
ASSERT(pix_height < 128);
|
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.jump_speed = -600;
|
|
|
|
actor->user.jump_grav = 8;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-09-09 17:52:52 +00:00
|
|
|
while (true)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:52:15 +00:00
|
|
|
if (GetBunnyJumpHeight(actor->user.jump_speed, actor->user.jump_grav) > pix_height + 20)
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.jump_speed -= 100;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
ASSERT(actor->user.jump_speed > -3000);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
return actor->user.jump_speed;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// JUMP ATTACK
|
|
|
|
//
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyBeginJumpAttack(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-24 20:00:29 +00:00
|
|
|
DSWActor* target = actor->user.targetActor;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2022-08-30 22:47:02 +00:00
|
|
|
DAngle tang = VecToAngle(target->spr.pos - actor->spr.pos);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2022-08-30 22:47:02 +00:00
|
|
|
Collision coll = move_sprite(actor, DVector3(tang.ToVector() * 8, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
2021-10-31 19:44:39 +00:00
|
|
|
|
2022-08-30 22:47:02 +00:00
|
|
|
auto rndang = DAngle::fromBuild(RANDOM_NEG(256, 6) >> 6);
|
2021-10-31 19:44:39 +00:00
|
|
|
if (coll.type != kHitNone)
|
2022-08-30 22:47:02 +00:00
|
|
|
actor->spr.angle += DAngle180 + rndang;
|
|
|
|
else
|
|
|
|
actor->spr.angle = tang + rndang;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 10:09:34 +00:00
|
|
|
DoActorSetSpeed(actor, FAST_SPEED);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-11-01 13:31:24 +00:00
|
|
|
PickJumpMaxSpeed(actor, -400); // was -800
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 16:13:47 +00:00
|
|
|
actor->user.Flags |= (SPR_JUMPING);
|
2021-12-27 17:58:15 +00:00
|
|
|
actor->user.Flags &= ~(SPR_FALLING);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// set up individual actor jump gravity
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.jump_grav = 17; // was 8
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// if I didn't do this here they get stuck in the air sometimes
|
2021-11-03 16:47:13 +00:00
|
|
|
DoActorZrange(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 21:38:21 +00:00
|
|
|
DoJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyMoveJump(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
int nx, ny;
|
|
|
|
|
|
|
|
// Move while jumping
|
2022-09-01 14:45:28 +00:00
|
|
|
nx = MulScale(actor->int_xvel(), bcos(actor->int_ang()), 14);
|
|
|
|
ny = MulScale(actor->int_xvel(), bsin(actor->int_ang()), 14);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 21:03:26 +00:00
|
|
|
move_actor(actor, nx, ny, 0L);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorFall(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-11-03 16:47:13 +00:00
|
|
|
DoActorZrange(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-29 18:49:57 +00:00
|
|
|
InitActorDecide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
void DoPickCloseBunny(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
int dist, near_dist = 1000, a,b,c;
|
|
|
|
|
|
|
|
// if actor can still see the player
|
2020-09-09 18:32:24 +00:00
|
|
|
bool ICanSee = false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
SWStatIterator it(STAT_ENEMY);
|
|
|
|
while (auto itActor = it.Next())
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-24 14:52:12 +00:00
|
|
|
if (actor == itActor) continue;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:28:40 +00:00
|
|
|
if (itActor->user.ID != BUNNY_RUN_R0) continue;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2022-08-21 14:03:46 +00:00
|
|
|
DISTANCE(itActor->spr.pos, actor->spr.pos, dist, a, b, c);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
if (dist > near_dist) continue;
|
|
|
|
|
2022-08-21 14:57:51 +00:00
|
|
|
ICanSee = FAFcansee(ActorVectOfTop(actor), actor->sector(), ActorUpperVect(itActor), itActor->sector());
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:28:40 +00:00
|
|
|
if (ICanSee && dist < near_dist && itActor->user.ID == BUNNY_RUN_R0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
near_dist = dist;
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.targetActor = itActor;
|
|
|
|
actor->user.lowActor = itActor;
|
2015-05-19 21:54:34 +00:00
|
|
|
//Bunny_Result = i;
|
2021-10-31 19:44:39 +00:00
|
|
|
return;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyQuickJump(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.spal != PALETTE_PLAYER8) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (!actor->user.lowActor&& actor->user.spal == PALETTE_PLAYER8 && MoveSkip4)
|
2021-10-31 19:44:39 +00:00
|
|
|
DoPickCloseBunny(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Random Chance of like sexes fighting
|
2021-12-25 19:52:15 +00:00
|
|
|
DSWActor* hitActor = actor->user.lowActor;
|
2021-12-07 18:22:30 +00:00
|
|
|
if (hitActor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 18:28:40 +00:00
|
|
|
if (!hitActor->hasU() || hitActor->user.ID != BUNNY_RUN_R0) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Not mature enough yet
|
2021-12-24 12:21:49 +00:00
|
|
|
if (actor->spr.xrepeat != 64 || actor->spr.yrepeat != 64) return false;
|
2021-12-24 20:00:29 +00:00
|
|
|
if (hitActor->spr.xrepeat != 64 || hitActor->spr.yrepeat != 64) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Kill a rival
|
|
|
|
// Only males fight
|
2021-12-25 18:28:40 +00:00
|
|
|
if (hitActor->user.spal == actor->spr.pal && RandomRange(1000) > 995)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.spal == PALETTE_PLAYER8 && hitActor->user.spal == PALETTE_PLAYER8)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-11-02 22:08:59 +00:00
|
|
|
PlaySound(DIGI_BUNNYATTACK, actor, v3df_follow);
|
|
|
|
PlaySound(DIGI_BUNNYDIE2, hitActor, v3df_follow);
|
2021-12-25 18:28:40 +00:00
|
|
|
hitActor->user.Health = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Blood fountains
|
2021-11-01 10:57:51 +00:00
|
|
|
InitBloodSpray(hitActor, true,-1);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 19:44:51 +00:00
|
|
|
if (SpawnShrap(hitActor, actor))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-30 20:44:16 +00:00
|
|
|
SetSuicide(hitActor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
else
|
2021-10-29 20:00:27 +00:00
|
|
|
DoActorDie(hitActor, actor, 0);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
Bunny_Count--; // Bunny died
|
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.lowActor = nullptr;
|
2020-09-09 17:52:52 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get layed!
|
2021-12-25 19:52:15 +00:00
|
|
|
hitActor = actor->user.lowActor;
|
|
|
|
if (hitActor && actor->user.spal == PALETTE_PLAYER8) // Only males check this
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 18:28:40 +00:00
|
|
|
if (!hitActor->hasU() || hitActor->user.ID != BUNNY_RUN_R0) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Not mature enough to mate yet
|
2021-12-24 12:21:49 +00:00
|
|
|
if (actor->spr.xrepeat != 64 || actor->spr.yrepeat != 64) return false;
|
2021-12-24 20:00:29 +00:00
|
|
|
if (hitActor->spr.xrepeat != 64 || hitActor->spr.yrepeat != 64) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (hitActor->user.ShellNum <= 0 && hitActor->user.WaitTics <= 0 && actor->user.WaitTics <= 0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-29 05:53:36 +00:00
|
|
|
if ((hitActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-31 14:59:11 +00:00
|
|
|
PLAYER* pp = nullptr;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:28:40 +00:00
|
|
|
if (RandomRange(1000) < 995 && hitActor->user.spal != PALETTE_PLAYER0) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 11:05:07 +00:00
|
|
|
DoActorPickClosePlayer(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.targetActor->user.PlayerP)
|
|
|
|
pp = actor->user.targetActor->user.PlayerP;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:28:40 +00:00
|
|
|
if (hitActor->user.spal != PALETTE_PLAYER0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 18:28:40 +00:00
|
|
|
if (hitActor->user.Flag1 > 0) return false;
|
|
|
|
hitActor->user.FlagOwner = 1; // FAG!
|
|
|
|
hitActor->user.Flag1 = SEC(10);
|
2015-05-19 21:54:34 +00:00
|
|
|
if (pp)
|
|
|
|
{
|
2021-10-31 19:44:39 +00:00
|
|
|
int choose_snd;
|
|
|
|
static const int fagsnds[] = {DIGI_FAGRABBIT1,DIGI_FAGRABBIT2,DIGI_FAGRABBIT3};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
if (pp == Player+myconnectindex)
|
|
|
|
{
|
2021-12-25 15:30:22 +00:00
|
|
|
choose_snd = StdRandomRange(2<<8)>>8;
|
2022-08-21 14:57:51 +00:00
|
|
|
if (FAFcansee(ActorVectOfTop(actor),actor->sector(),pp->pos, pp->cursector) && Facing(actor, actor->user.targetActor))
|
2019-12-18 10:09:01 +00:00
|
|
|
PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-20 06:59:54 +00:00
|
|
|
if (pp && RandomRange(1000) > 200)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-31 19:44:39 +00:00
|
|
|
int choose_snd;
|
|
|
|
static const int straightsnds[] = {DIGI_RABBITHUMP1,DIGI_RABBITHUMP2, DIGI_RABBITHUMP3,DIGI_RABBITHUMP4};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
if (pp == Player+myconnectindex)
|
|
|
|
{
|
2021-12-25 15:30:22 +00:00
|
|
|
choose_snd = StdRandomRange(3<<8)>>8;
|
2022-08-21 14:57:51 +00:00
|
|
|
if (FAFcansee(ActorVectOfTop(actor), actor->sector(), pp->pos, pp->cursector) && Facing(actor, actor->user.targetActor))
|
|
|
|
PlayerSound(straightsnds[choose_snd], v3df_doppler | v3df_follow | v3df_dontpan, pp);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-29 17:27:52 +00:00
|
|
|
actor->spr.pos.XY() = hitActor->spr.pos.XY();
|
2022-08-28 03:15:31 +00:00
|
|
|
actor->spr.angle = hitActor->spr.angle;
|
2022-08-29 00:40:31 +00:00
|
|
|
actor->spr.angle += DAngle180;
|
2021-11-04 22:27:04 +00:00
|
|
|
HelpMissileLateral(actor, 2000);
|
2022-08-28 03:15:31 +00:00
|
|
|
actor->spr.angle = hitActor->spr.angle;
|
2022-08-16 21:17:01 +00:00
|
|
|
actor->user.Vis = actor->int_ang(); // Remember angles for later
|
|
|
|
hitActor->user.Vis = hitActor->int_ang();
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 21:12:31 +00:00
|
|
|
NewStateGroup(actor, sg_BunnyScrew);
|
2021-10-30 22:29:54 +00:00
|
|
|
NewStateGroup(hitActor, sg_BunnyScrew);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.WaitTics = hitActor->user.WaitTics = SEC(10); // Mate for this long
|
2020-09-09 17:52:52 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-09 17:52:52 +00:00
|
|
|
return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int NullBunny(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorFall(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// stay on floor unless doing certain things
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2021-10-29 20:34:54 +00:00
|
|
|
KeepActorOnFloor(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_SLIDING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSlide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSectorDamage(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
int DoBunnyPain(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-29 18:49:57 +00:00
|
|
|
NullBunny(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if ((actor->user.WaitTics -= ACTORMOVETICS) <= 0)
|
2021-10-29 18:49:57 +00:00
|
|
|
InitActorDecide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
int DoBunnyRipHeart(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-24 20:00:29 +00:00
|
|
|
DSWActor* target = actor->user.targetActor;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 21:12:31 +00:00
|
|
|
NewStateGroup(actor, sg_BunnyHeart);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.WaitTics = 6 * 120;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// player face bunny
|
2022-08-20 19:14:00 +00:00
|
|
|
target->spr.angle = VecToAngle(actor->spr.pos - target->spr.pos);
|
2015-05-19 21:54:34 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
int DoBunnyStandKill(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-29 18:49:57 +00:00
|
|
|
NullBunny(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Growl like the bad ass bunny you are!
|
2021-09-20 06:59:54 +00:00
|
|
|
if (RandomRange(1000) > 800)
|
2021-11-02 22:08:59 +00:00
|
|
|
PlaySound(DIGI_BUNNYATTACK, actor, v3df_none);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if ((actor->user.WaitTics -= ACTORMOVETICS) <= 0)
|
2021-10-30 21:12:31 +00:00
|
|
|
NewStateGroup(actor, sg_BunnyRun);
|
2015-05-19 21:54:34 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
|
|
|
|
void BunnyHatch(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-31 19:44:39 +00:00
|
|
|
const int MAX_BUNNYS = 1;
|
2021-11-21 20:47:37 +00:00
|
|
|
int16_t rip_ang[MAX_BUNNYS];
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
rip_ang[0] = RANDOM_P2(2048);
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
for (int i = 0; i < MAX_BUNNYS; i++)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
|
2022-02-07 07:47:18 +00:00
|
|
|
actorNew->spr.pos = actor->spr.pos;
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.xrepeat = 30; // Baby size
|
|
|
|
actorNew->spr.yrepeat = 24;
|
2022-08-16 21:23:23 +00:00
|
|
|
actorNew->set_int_ang(rip_ang[i]);
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.pal = 0;
|
2021-10-31 19:44:39 +00:00
|
|
|
SetupBunny(actorNew);
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.shade = actor->spr.shade;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// make immediately active
|
2021-12-27 16:13:47 +00:00
|
|
|
actorNew->user.Flags |= (SPR_ACTIVE);
|
2021-09-20 06:59:54 +00:00
|
|
|
if (RandomRange(1000) > 500) // Boy or Girl?
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_PLAYER0; // Girl
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
|
|
|
{
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_PLAYER8; // Boy
|
2015-05-19 21:54:34 +00:00
|
|
|
// Oops, mommy died giving birth to a boy
|
2021-09-20 06:59:54 +00:00
|
|
|
if (RandomRange(1000) > 500)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Health = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
Bunny_Count--; // Bunny died
|
|
|
|
|
|
|
|
// Blood fountains
|
2021-11-01 10:57:51 +00:00
|
|
|
InitBloodSpray(actor, true, -1);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-30 19:44:51 +00:00
|
|
|
if (SpawnShrap(actor, actorNew))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-30 20:44:16 +00:00
|
|
|
SetSuicide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
else
|
2021-10-29 20:00:27 +00:00
|
|
|
DoActorDie(actor, actorNew, 0);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.ShellNum = 0; // Not Pregnant right now
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
NewStateGroup(actorNew, actorNew->user.ActorActionSet->Jump);
|
|
|
|
actorNew->user.ActorActionFunc = DoActorMoveJump;
|
2021-10-30 10:09:34 +00:00
|
|
|
DoActorSetSpeed(actorNew, FAST_SPEED);
|
2021-11-01 13:31:24 +00:00
|
|
|
PickJumpMaxSpeed(actorNew, -600);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 16:13:47 +00:00
|
|
|
actorNew->user.Flags |= (SPR_JUMPING);
|
2021-12-27 17:58:15 +00:00
|
|
|
actorNew->user.Flags &= ~(SPR_FALLING);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.jump_grav = 8;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// if I didn't do this here they get stuck in the air sometimes
|
2021-11-03 16:47:13 +00:00
|
|
|
DoActorZrange(actorNew);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actorNew);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
DSWActor* BunnyHatch2(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
auto actorNew = insertActor(actor->sector(), STAT_DEFAULT);
|
2022-02-07 07:47:18 +00:00
|
|
|
actorNew->spr.pos = actor->spr.pos;
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.xrepeat = 30; // Baby size
|
|
|
|
actorNew->spr.yrepeat = 24;
|
2022-08-21 17:08:22 +00:00
|
|
|
actorNew->spr.angle = RANDOM_ANGLE();
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.pal = 0;
|
2021-10-31 19:44:39 +00:00
|
|
|
SetupBunny(actorNew);
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.shade = actor->spr.shade;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// make immediately active
|
2021-12-27 16:13:47 +00:00
|
|
|
actorNew->user.Flags |= (SPR_ACTIVE);
|
2021-09-20 06:59:54 +00:00
|
|
|
if (RandomRange(1000) > 500) // Boy or Girl?
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_PLAYER0; // Girl
|
|
|
|
actorNew->user.Flag1 = SEC(5);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.spal = actorNew->spr.pal = PALETTE_PLAYER8; // Boy
|
|
|
|
actorNew->user.Flag1 = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.ShellNum = 0; // Not Pregnant right now
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
NewStateGroup(actorNew, actorNew->user.ActorActionSet->Jump);
|
|
|
|
actorNew->user.ActorActionFunc = DoActorMoveJump;
|
2021-10-30 10:09:34 +00:00
|
|
|
DoActorSetSpeed(actorNew, FAST_SPEED);
|
2021-12-24 14:52:12 +00:00
|
|
|
if (TEST_BOOL3(actor))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-11-01 13:31:24 +00:00
|
|
|
PickJumpMaxSpeed(actorNew, -600-RandomRange(600));
|
2021-12-24 18:41:29 +00:00
|
|
|
actorNew->spr.xrepeat = actorNew->spr.yrepeat = 64;
|
2022-09-01 14:57:55 +00:00
|
|
|
actorNew->set_int_xvel(150 + RandomRange(1000));
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.Health = 1; // Easy to pop. Like shootn' skeet.
|
2022-08-16 21:27:44 +00:00
|
|
|
actorNew->add_int_ang(-RandomRange(128));
|
2022-08-16 21:26:39 +00:00
|
|
|
actorNew->add_int_ang(RandomRange(128));
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
else
|
2021-11-01 13:31:24 +00:00
|
|
|
PickJumpMaxSpeed(actorNew, -600);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-27 16:13:47 +00:00
|
|
|
actorNew->user.Flags |= (SPR_JUMPING);
|
2021-12-27 17:58:15 +00:00
|
|
|
actorNew->user.Flags &= ~(SPR_FALLING);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.jump_grav = 8;
|
|
|
|
actorNew->user.FlagOwner = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 18:57:14 +00:00
|
|
|
actorNew->user.active_range = 75000; // Set it far
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// if I didn't do this here they get stuck in the air sometimes
|
2021-11-03 16:47:13 +00:00
|
|
|
DoActorZrange(actorNew);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actorNew);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
return actorNew;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyMove(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
// Parental lock crap
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->spr.cstat & (CSTAT_SPRITE_INVISIBLE))
|
2021-12-27 17:58:15 +00:00
|
|
|
actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE); // Turn em' back on
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Sometimes they just won't die!
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.Health <= 0)
|
2021-10-30 20:44:16 +00:00
|
|
|
SetSuicide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.scale_speed)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-29 19:06:37 +00:00
|
|
|
DoScaleSprite(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorFall(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// if on a player/enemy sprite jump quickly
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-29 18:49:57 +00:00
|
|
|
DoBunnyQuickJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_SLIDING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSlide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.track >= 0)
|
2021-11-01 13:36:46 +00:00
|
|
|
ActorFollowTrack(actor, ACTORMOVETICS);
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
2021-12-25 19:52:15 +00:00
|
|
|
(*actor->user.ActorActionFunc)(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// stay on floor unless doing certain things
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2021-10-29 20:34:54 +00:00
|
|
|
KeepActorOnFloor(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSectorDamage(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (RandomRange(1000) > 985 && actor->spr.pal != PALETTE_PLAYER1 && actor->user.track < 0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
switch (actor->sector()->floorpicnum)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case 153:
|
|
|
|
case 154:
|
|
|
|
case 193:
|
|
|
|
case 219:
|
|
|
|
case 2636:
|
|
|
|
case 2689:
|
|
|
|
case 3561:
|
|
|
|
case 3562:
|
|
|
|
case 3563:
|
|
|
|
case 3564:
|
2021-10-30 21:16:07 +00:00
|
|
|
NewStateGroup(actor,sg_BunnyStand);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
2022-08-16 21:23:23 +00:00
|
|
|
actor->set_int_ang(NORM_ANGLE(RandomRange(2048 << 6) >> 6));
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.jump_speed = -350;
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorBeginJump(actor);
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.ActorActionFunc = DoActorMoveJump;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int BunnySpew(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-11-01 10:57:51 +00:00
|
|
|
InitBloodSpray(actor, true, -1);
|
2015-05-19 21:54:34 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyEat(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorFall(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// if on a player/enemy sprite jump quickly
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-10-29 18:49:57 +00:00
|
|
|
DoBunnyQuickJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_SLIDING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSlide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// stay on floor unless doing certain things
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2021-10-29 20:34:54 +00:00
|
|
|
KeepActorOnFloor(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSectorDamage(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
switch (actor->sector()->floorpicnum)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case 153:
|
|
|
|
case 154:
|
|
|
|
case 193:
|
|
|
|
case 219:
|
|
|
|
case 2636:
|
|
|
|
case 2689:
|
|
|
|
case 3561:
|
|
|
|
case 3562:
|
|
|
|
case 3563:
|
|
|
|
case 3564:
|
2021-09-20 06:59:54 +00:00
|
|
|
if (RandomRange(1000) > 970)
|
2021-10-30 21:16:07 +00:00
|
|
|
NewStateGroup(actor,sg_BunnyRun);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
2021-10-30 21:16:07 +00:00
|
|
|
NewStateGroup(actor,sg_BunnyRun);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyScrew(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_JUMPING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorJump(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
else
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorFall(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-27 18:34:06 +00:00
|
|
|
if (actor->user.Flags & (SPR_SLIDING))
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSlide(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// stay on floor unless doing certain things
|
2021-12-27 19:22:21 +00:00
|
|
|
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
2021-10-29 20:34:54 +00:00
|
|
|
KeepActorOnFloor(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-10-29 18:49:57 +00:00
|
|
|
DoActorSectorDamage(actor);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-09-20 06:59:54 +00:00
|
|
|
if (RandomRange(1000) > 990) // Bunny sex sounds
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-11-02 22:08:59 +00:00
|
|
|
PlaySound(DIGI_BUNNYATTACK, actor, v3df_follow);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.WaitTics -= ACTORMOVETICS;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if ((actor->user.FlagOwner || actor->user.spal == PALETTE_PLAYER0) && actor->user.WaitTics > 0) // Keep Girl still
|
2021-10-30 21:16:07 +00:00
|
|
|
NewStateGroup(actor,sg_BunnyScrew);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.spal == PALETTE_PLAYER0 && actor->user.WaitTics <= 0) // Female has baby
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Flag1 = SEC(5); // Count down to babies
|
|
|
|
actor->user.ShellNum = 1; // She's pregnant now
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->user.WaitTics <= 0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-27 17:58:15 +00:00
|
|
|
actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE); // Turn em' back on
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.FlagOwner = 0;
|
2021-10-30 21:16:07 +00:00
|
|
|
NewStateGroup(actor,sg_BunnyRun);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-10-31 19:44:39 +00:00
|
|
|
int DoBunnyGrowUp(DSWActor* actor)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-24 12:21:49 +00:00
|
|
|
if (actor->spr.pal == PALETTE_PLAYER1) return 0; // Don't bother white bunnies
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-25 19:52:15 +00:00
|
|
|
if ((actor->user.Counter -= ACTORMOVETICS) <= 0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-24 12:21:49 +00:00
|
|
|
if ((++actor->spr.xrepeat) > 64) actor->spr.xrepeat = 64;
|
|
|
|
if ((++actor->spr.yrepeat) > 64) actor->spr.yrepeat = 64;
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.Counter = 60;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Don't go homo too much!
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->spr.pal != PALETTE_PLAYER0 && actor->user.Flag1 > 0)
|
|
|
|
actor->user.Flag1 -= ACTORMOVETICS;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Gestation period for female rabbits
|
2021-12-25 19:52:15 +00:00
|
|
|
if (actor->spr.pal == PALETTE_PLAYER0 && actor->user.ShellNum > 0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-25 19:52:15 +00:00
|
|
|
if ((actor->user.Flag1 -= ACTORMOVETICS) <= 0)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
if (Bunny_Count < 20)
|
|
|
|
{
|
2021-11-02 22:08:59 +00:00
|
|
|
PlaySound(DIGI_BUNNYDIE2, actor, v3df_follow);
|
2021-10-31 19:44:39 +00:00
|
|
|
BunnyHatch(actor); // Baby time
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
2021-12-25 19:52:15 +00:00
|
|
|
actor->user.ShellNum = 0; // Not pregnent anymore
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#include "saveable.h"
|
|
|
|
|
|
|
|
static saveable_code saveable_bunny_code[] =
|
|
|
|
{
|
|
|
|
SAVE_CODE(DoBunnyBeginJumpAttack),
|
|
|
|
SAVE_CODE(DoBunnyMoveJump),
|
|
|
|
SAVE_CODE(DoPickCloseBunny),
|
|
|
|
SAVE_CODE(DoBunnyQuickJump),
|
|
|
|
SAVE_CODE(NullBunny),
|
|
|
|
SAVE_CODE(DoBunnyPain),
|
|
|
|
SAVE_CODE(DoBunnyRipHeart),
|
|
|
|
SAVE_CODE(DoBunnyStandKill),
|
|
|
|
SAVE_CODE(DoBunnyMove),
|
|
|
|
SAVE_CODE(BunnySpew),
|
|
|
|
SAVE_CODE(DoBunnyEat),
|
|
|
|
SAVE_CODE(DoBunnyScrew),
|
|
|
|
SAVE_CODE(DoBunnyGrowUp),
|
|
|
|
};
|
|
|
|
|
|
|
|
static saveable_data saveable_bunny_data[] =
|
|
|
|
{
|
|
|
|
SAVE_DATA(BunnyBattle),
|
|
|
|
SAVE_DATA(BunnyOffense),
|
|
|
|
SAVE_DATA(BunnyBroadcast),
|
|
|
|
SAVE_DATA(BunnySurprised),
|
|
|
|
SAVE_DATA(BunnyEvasive),
|
|
|
|
SAVE_DATA(BunnyLostTarget),
|
|
|
|
SAVE_DATA(BunnyCloseRange),
|
|
|
|
SAVE_DATA(BunnyWander),
|
|
|
|
|
|
|
|
SAVE_DATA(WhiteBunnyPersonality),
|
|
|
|
SAVE_DATA(BunnyPersonality),
|
|
|
|
|
|
|
|
SAVE_DATA(WhiteBunnyAttrib),
|
|
|
|
SAVE_DATA(BunnyAttrib),
|
|
|
|
|
|
|
|
SAVE_DATA(s_BunnyRun),
|
|
|
|
SAVE_DATA(sg_BunnyRun),
|
|
|
|
SAVE_DATA(s_BunnyStand),
|
|
|
|
SAVE_DATA(sg_BunnyStand),
|
|
|
|
SAVE_DATA(s_BunnyScrew),
|
|
|
|
SAVE_DATA(sg_BunnyScrew),
|
|
|
|
SAVE_DATA(s_BunnySwipe),
|
|
|
|
SAVE_DATA(sg_BunnySwipe),
|
|
|
|
SAVE_DATA(s_BunnyHeart),
|
|
|
|
SAVE_DATA(sg_BunnyHeart),
|
|
|
|
SAVE_DATA(s_BunnyPain),
|
|
|
|
SAVE_DATA(sg_BunnyPain),
|
|
|
|
SAVE_DATA(s_BunnyJump),
|
|
|
|
SAVE_DATA(sg_BunnyJump),
|
|
|
|
SAVE_DATA(s_BunnyFall),
|
|
|
|
SAVE_DATA(sg_BunnyFall),
|
|
|
|
SAVE_DATA(s_BunnyJumpAttack),
|
|
|
|
SAVE_DATA(sg_BunnyJumpAttack),
|
|
|
|
SAVE_DATA(s_BunnyDie),
|
|
|
|
SAVE_DATA(sg_BunnyDie),
|
|
|
|
SAVE_DATA(s_BunnyDead),
|
|
|
|
SAVE_DATA(sg_BunnyDead),
|
|
|
|
SAVE_DATA(s_BunnyDeathJump),
|
|
|
|
SAVE_DATA(sg_BunnyDeathJump),
|
|
|
|
SAVE_DATA(s_BunnyDeathFall),
|
|
|
|
SAVE_DATA(sg_BunnyDeathFall),
|
|
|
|
|
|
|
|
SAVE_DATA(BunnyActionSet),
|
|
|
|
SAVE_DATA(BunnyWhiteActionSet),
|
|
|
|
};
|
|
|
|
|
|
|
|
saveable_module saveable_bunny =
|
|
|
|
{
|
|
|
|
// code
|
|
|
|
saveable_bunny_code,
|
|
|
|
SIZ(saveable_bunny_code),
|
|
|
|
|
|
|
|
// data
|
|
|
|
saveable_bunny_data,
|
|
|
|
SIZ(saveable_bunny_data)
|
|
|
|
};
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|