Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 68 additions & 7 deletions src/SB/Game/zNPCTypeDutchman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,20 @@ void zNPCDutchman::reset_speed()
{
}

//S32 zNPCGoalDutchmanInitiate::Exit(F32 dt, void* updCtxt)
//{
// return xGoal::Exit(dt, updCtxt);
//}
xFactoryInst* zNPCGoalDutchmanInitiate::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanInitiate(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanInitiate::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanIdle::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanIdle(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanIdle::Enter(F32 dt, void* updCtxt)
{
Expand Down Expand Up @@ -396,27 +406,52 @@ S32 zNPCGoalDutchmanDisappear::Exit(F32 dt, void* updCtxt)
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanDamage::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanDamage(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanDamage::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanTeleport::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanTeleport(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanTeleport::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanReappear::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanReappear(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanReappear::Exit(F32 dt, void* updCtxt)
{
owner.reset_speed();
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanBeam::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanBeam(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanBeam::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanFlame::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanFlame(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanFlame::Enter(F32 dt, void* updCtxt)
{
owner.reset_lasso_anim();
Expand All @@ -439,6 +474,29 @@ S32 zNPCGoalDutchmanFlame::Exit(F32 dt, void* updCtxt)
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanPostFlame::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanPostFlame(who, (zNPCDutchman&)*info);
}


S32 zNPCGoalDutchmanPostFlame::Exit(F32 dt, void* updCtxt)
{
owner.flag.hurting = 0;
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanCaught::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanCaught(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanCaught::Enter(float dt, void* updCtxt)
{
// TODO
return zNPCGoalCommon::Enter(dt, updCtxt);
}

S32 zNPCGoalDutchmanCaught::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
Expand All @@ -452,12 +510,15 @@ S32 zNPCGoalDutchmanDeath::Enter(F32 dt, void* updCtxt)

S32 zNPCGoalDutchmanDeath::Exit(F32 dt, void* updCtxt)
{
// Not sure how this is supposed to be called?
// dwarf dats shows: xVec3& up = dt;
owner.move.dest.assign(dt, 0.0f, 1.0f);
owner.move.dest.assign(dt, 1.0f, 0.0f);
return xGoal::Exit(dt, updCtxt);
}

xFactoryInst* zNPCGoalDutchmanDeath::create(S32 who, RyzMemGrow* grow, void* info)
{
return new (who, grow) zNPCGoalDutchmanDeath(who, (zNPCDutchman&)*info);
}

S32 zNPCGoalDutchmanDeath::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn)
{
if (owner.delay >= 2.0f)
Expand Down
49 changes: 49 additions & 0 deletions src/SB/Game/zNPCTypeDutchman.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ struct zNPCGoalDutchmanNil : zNPCGoalCommon
struct zNPCGoalDutchmanInitiate : zNPCGoalCommon
{
zNPCDutchman& owner;

zNPCGoalDutchmanInitiate(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
Expand All @@ -195,6 +200,11 @@ struct zNPCGoalDutchmanInitiate : zNPCGoalCommon
struct zNPCGoalDutchmanIdle : zNPCGoalCommon
{
zNPCDutchman& owner;

zNPCGoalDutchmanIdle(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Enter(float, void*);
S32 Exit(float, void*);
S32 Process(en_trantype*, float, void*, xScene*);
Expand All @@ -217,6 +227,11 @@ struct zNPCGoalDutchmanDisappear : zNPCGoalCommon
struct zNPCGoalDutchmanTeleport : zNPCGoalCommon
{
zNPCDutchman& owner;

zNPCGoalDutchmanTeleport(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
Expand All @@ -225,6 +240,11 @@ struct zNPCGoalDutchmanTeleport : zNPCGoalCommon
struct zNPCGoalDutchmanReappear : zNPCGoalCommon
{
zNPCDutchman& owner;

zNPCGoalDutchmanReappear(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Exit(float, void*);
void reset_speed();

Expand Down Expand Up @@ -259,6 +279,11 @@ struct zNPCGoalDutchmanBeam : zNPCGoalCommon
S32 shots;
beam_data beam[2];
zNPCDutchman& owner;

zNPCGoalDutchmanBeam(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Exit(float, void*);
static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};
Expand All @@ -277,6 +302,11 @@ struct zNPCGoalDutchmanFlame : zNPCGoalCommon
xVec2 move_dir;
U8 stopped;
zNPCDutchman& owner;

zNPCGoalDutchmanFlame(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Enter(float, void*);
S32 Exit(float, void*);

Expand All @@ -287,13 +317,24 @@ struct zNPCGoalDutchmanPostFlame : zNPCGoalCommon
{
zNPCDutchman& owner;

zNPCGoalDutchmanPostFlame(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
S32 Exit(F32 dt, void* updCtxt);
};

struct zNPCGoalDutchmanCaught : zNPCGoalCommon
{
U8 grabbed;
zNPCDutchman& owner;

zNPCGoalDutchmanCaught(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

S32 Enter(float, void*);
S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
Expand All @@ -304,6 +345,10 @@ struct zNPCGoalDutchmanDamage : zNPCGoalCommon
U8 moving;
zNPCDutchman& owner;

zNPCGoalDutchmanDamage(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
S32 Exit(F32 dt, void* updCtxt);
};
Expand All @@ -324,6 +369,10 @@ struct zNPCGoalDutchmanDeath : zNPCGoalCommon
SS_DONE
};

zNPCGoalDutchmanDeath(S32 goalID, zNPCDutchman& npc) : zNPCGoalCommon(goalID), owner(npc)
{
}

substate_enum substate;
F32 emit_frac;
F32 min_y;
Expand Down