Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Sep 16, 2024
1 parent 018a294 commit 06737bb
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/smw/GSGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ void LoadMapObjects(bool fPreview)
for (short x = 0; x < MAPWIDTH; x++) {
for (short y = 0; y < MAPHEIGHT; y++) {
const short typeId = g_map->objectdata[x][y].iType;
IO_Block* block = spawnMapBlock(typeId, {x * 32, y * 32}, g_map->objectdata[x][y], g_map->iSwitches);
IO_Block* block = spawnMapBlock(typeId, Vec2s(x * 32, y * 32), g_map->objectdata[x][y], g_map->iSwitches);
g_map->blockdata[x][y] = block;

if (block)
Expand Down
2 changes: 1 addition & 1 deletion src/smw/gamemodes/Chase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void CGM_Chase::init()
//Add phantos based on settings
for (short iPhanto = 0; iPhanto < 3; iPhanto++) {
for (short iNumPhantos = 0; iNumPhantos < game_values.gamemodesettings.chase.phantoquantity[iPhanto]; iNumPhantos++)
objectcontainer[1].add(new OMO_Phanto(&rm->spr_phanto, {RANDOM_INT(App::screenWidth), RANDOM_BOOL() ? -32 - CRUNCHMAX : App::screenHeight}, 0.0f, 0.0f, iPhanto));
objectcontainer[1].add(new OMO_Phanto(&rm->spr_phanto, Vec2s(RANDOM_INT(App::screenWidth), RANDOM_BOOL() ? -32 - CRUNCHMAX : App::screenHeight), 0.0f, 0.0f, iPhanto));
}

//Add a key
Expand Down
2 changes: 1 addition & 1 deletion src/smw/objectgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ IO_MovingObject* createpowerup(short iType, Vec2s pos, bool side, bool spawn)
}
} else {
//If no powerups were selected for this block, then fire out a podobo
IO_MovingObject * podobo = new MO_Podobo(&rm->spr_podobo, {pos.x + 2, pos.y}, -(float(RANDOM_INT(5)) / 2.0f) - 6.0f, -1, -1, -1, true);
IO_MovingObject * podobo = new MO_Podobo(&rm->spr_podobo, Vec2s(pos.x + 2, pos.y), -(float(RANDOM_INT(5)) / 2.0f) - 6.0f, -1, -1, -1, true);
objectcontainer[2].add(podobo);
return podobo;
}
Expand Down
8 changes: 4 additions & 4 deletions src/smw/objecthazard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ void LoadMapHazards(bool fPreview)
MapHazard * hazard = &g_map->maphazards[iMapHazard];
if (hazard->itype == 0) {
for (short iFireball = 0; iFireball < hazard->iparam[0]; iFireball++)
objectcontainer[1].add(new OMO_OrbitHazard(&rm->spr_hazard_fireball[fPreview ? 1 : 0], {(hazard->ix << 4) + 16, (hazard->iy << 4) + 16}, (float)(iFireball * 24), hazard->dparam[0], hazard->dparam[1], 4, 8, 18, 18, 0, 0, 0, hazard->dparam[0] < 0.0f ? 18 : 0, 18, 18));
objectcontainer[1].add(new OMO_OrbitHazard(&rm->spr_hazard_fireball[fPreview ? 1 : 0], Vec2s((hazard->ix << 4) + 16, (hazard->iy << 4) + 16), (float)(iFireball * 24), hazard->dparam[0], hazard->dparam[1], 4, 8, 18, 18, 0, 0, 0, hazard->dparam[0] < 0.0f ? 18 : 0, 18, 18));
} else if (hazard->itype == 1) {
float dSector = TWO_PI / hazard->iparam[0];
for (short iRotoDisc = 0; iRotoDisc < hazard->iparam[0]; iRotoDisc++) {
float dAngle = hazard->dparam[1] + iRotoDisc * dSector;
if (dAngle > TWO_PI)
dAngle -= TWO_PI;

objectcontainer[1].add(new OMO_OrbitHazard(&rm->spr_hazard_rotodisc[fPreview ? 1 : 0], {(hazard->ix << 4) + 16, (hazard->iy << 4) + 16}, hazard->dparam[2], hazard->dparam[0], dAngle, 21, 8, 32, 32, 0, 0, 0, 0, 32, 32));
objectcontainer[1].add(new OMO_OrbitHazard(&rm->spr_hazard_rotodisc[fPreview ? 1 : 0], Vec2s((hazard->ix << 4) + 16, (hazard->iy << 4) + 16), hazard->dparam[2], hazard->dparam[0], dAngle, 21, 8, 32, 32, 0, 0, 0, 0, 32, 32));
}
} else if (hazard->itype == 2) {
noncolcontainer.add(new IO_BulletBillCannon({hazard->ix << 4, hazard->iy << 4}, hazard->iparam[0], hazard->dparam[0], fPreview));
noncolcontainer.add(new IO_BulletBillCannon(Vec2s(hazard->ix << 4, hazard->iy << 4), hazard->iparam[0], hazard->dparam[0], fPreview));
} else if (hazard->itype == 3) {
objectcontainer[1].add(new IO_FlameCannon(hazard->ix << 4, hazard->iy << 4, hazard->iparam[0], hazard->iparam[1]));
} else if (hazard->itype >= 4 && hazard->itype <= 7) {
objectcontainer[1].add(new MO_PirhanaPlant({hazard->ix << 4, hazard->iy << 4}, hazard->itype - 4, hazard->iparam[0], hazard->iparam[1], fPreview));
objectcontainer[1].add(new MO_PirhanaPlant(Vec2s(hazard->ix << 4, hazard->iy << 4), hazard->itype - 4, hazard->iparam[0], hazard->iparam[1], fPreview));
}
}
}
2 changes: 1 addition & 1 deletion src/smw/objects/IO_BulletBillCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void IO_BulletBillCannon::update()
if (--iTimer <= 0) {
SetNewTimer();

objectcontainer[1].add(new MO_BulletBill(&rm->spr_hazard_bulletbill[fPreview ? 1 : 0], &rm->spr_hazard_bulletbilldead, {ix + (dVel < 0.0f ? 32 : -32), iy}, dVel, 0, true));
objectcontainer[1].add(new MO_BulletBill(&rm->spr_hazard_bulletbill[fPreview ? 1 : 0], &rm->spr_hazard_bulletbilldead, Vec2s(ix + (dVel < 0.0f ? 32 : -32), iy), dVel, 0, true));
ifSoundOnPlay(rm->sfx_bulletbillsound);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/carriable/CO_Bomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ void CO_Bomb::Die()
player->decreaseProjectilesCount();

dead = true;
objectcontainer[2].add(new MO_Explosion(&rm->spr_explosion, {ix + (iw >> 2) - 96, iy + (ih >> 2) - 64}, 2, 4, iPlayerID, iTeamID, KillStyle::Bomb));
objectcontainer[2].add(new MO_Explosion(&rm->spr_explosion, Vec2s(ix + (iw >> 2) - 96, iy + (ih >> 2) - 64), 2, 4, iPlayerID, iTeamID, KillStyle::Bomb));
ifSoundOnPlay(rm->sfx_bobombsound);
}
2 changes: 1 addition & 1 deletion src/smw/objects/carriable/CO_Egg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void CO_Egg::update()
if (--explosiondrawtimer <= 0) {
explosiondrawtimer = 62;
if (--explosiondrawframe < 0) {
objectcontainer[2].add(new MO_Explosion(&rm->spr_explosion, {ix + (iw >> 1) - 96, iy + (ih >> 1) - 64}, 2, 4, -1, -1, KillStyle::Bomb));
objectcontainer[2].add(new MO_Explosion(&rm->spr_explosion, Vec2s(ix + (iw >> 1) - 96, iy + (ih >> 1) - 64), 2, 4, -1, -1, KillStyle::Bomb));
placeEgg();

ifSoundOnPlay(rm->sfx_bobombsound);
Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/overmap/WO_OrbitHazard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OMO_OrbitHazard::OMO_OrbitHazard(gfxSprite* nspr, Vec2s pos, float radius, float
dRadius = radius;
dVel = vel;
dAngle = angle;
dCenter = {pos.x, pos.y};
dCenter = Vec2f(pos.x, pos.y);

CalculatePosition();
}
Expand Down
18 changes: 9 additions & 9 deletions src/smw/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1375,10 +1375,10 @@ void CPlayer::CommitAction()
{
if (PlayerAction::Bobomb == action) {
bobomb = false;
objectcontainer[2].add(new MO_Explosion(&rm->spr_explosion, {ix + HALFPW - 96, iy + HALFPH - 64}, 2, 4, globalID, teamID, KillStyle::Bobomb));
objectcontainer[2].add(new MO_Explosion(&rm->spr_explosion, Vec2s(ix + HALFPW - 96, iy + HALFPH - 64), 2, 4, globalID, teamID, KillStyle::Bobomb));
ifSoundOnPlay(rm->sfx_bobombsound);
} else if (PlayerAction::Fireball == action) {
objectcontainer[0].add(new MO_Fireball(&rm->spr_fireball, {ix + 6, iy}, 4, isFacingRight(), 5, globalID, teamID, colorID));
objectcontainer[0].add(new MO_Fireball(&rm->spr_fireball, Vec2s(ix + 6, iy), 4, isFacingRight(), 5, globalID, teamID, colorID));
ifSoundOnPlay(rm->sfx_fireball);

projectiles++;
Expand All @@ -1387,9 +1387,9 @@ void CPlayer::CommitAction()
DecreaseProjectileLimit();
} else if (PlayerAction::Hammer == action) {
if (isFacingRight()) {
objectcontainer[2].add(new MO_Hammer(&rm->spr_hammer, {ix + 8, iy}, 6, {(game_values.reversewalk ? -velx : velx) + 2.0f, -HAMMERTHROW}, 5, globalID, teamID, colorID, false));
objectcontainer[2].add(new MO_Hammer(&rm->spr_hammer, Vec2s(ix + 8, iy), 6, {(game_values.reversewalk ? -velx : velx) + 2.0f, -HAMMERTHROW}, 5, globalID, teamID, colorID, false));
} else {
objectcontainer[2].add(new MO_Hammer(&rm->spr_hammer, {ix - 14, iy}, 6, {(game_values.reversewalk ? -velx : velx) - 2.0f, -HAMMERTHROW}, 5, globalID, teamID, colorID, false));
objectcontainer[2].add(new MO_Hammer(&rm->spr_hammer, Vec2s(ix - 14, iy), 6, {(game_values.reversewalk ? -velx : velx) - 2.0f, -HAMMERTHROW}, 5, globalID, teamID, colorID, false));
}
projectiles++;

Expand All @@ -1399,16 +1399,16 @@ void CPlayer::CommitAction()
if (game_values.hammerlimit > 0)
DecreaseProjectileLimit();
} else if (PlayerAction::Boomerang == action) {
objectcontainer[2].add(new MO_Boomerang(&rm->spr_boomerang, {ix, iy + HALFPH - 16}, 4, isFacingRight(), 5, globalID, teamID, colorID));
objectcontainer[2].add(new MO_Boomerang(&rm->spr_boomerang, Vec2s(ix, iy + HALFPH - 16), 4, isFacingRight(), 5, globalID, teamID, colorID));
projectiles++;

if (game_values.boomeranglimit > 0)
DecreaseProjectileLimit();
} else if (PlayerAction::Iceblast == action) {
if (isFacingRight())
objectcontainer[2].add(new MO_IceBlast(&rm->spr_iceblast, {ix + HALFPW - 2, iy + HALFPH - 16}, 5.0f, globalID, teamID, colorID));
objectcontainer[2].add(new MO_IceBlast(&rm->spr_iceblast, Vec2s(ix + HALFPW - 2, iy + HALFPH - 16), 5.0f, globalID, teamID, colorID));
else
objectcontainer[2].add(new MO_IceBlast(&rm->spr_iceblast, {ix + HALFPW - 30, iy + HALFPH - 16}, -5.0f, globalID, teamID, colorID));
objectcontainer[2].add(new MO_IceBlast(&rm->spr_iceblast, Vec2s(ix + HALFPW - 30, iy + HALFPH - 16), -5.0f, globalID, teamID, colorID));

projectiles++;

Expand All @@ -1417,7 +1417,7 @@ void CPlayer::CommitAction()
if (game_values.wandlimit > 0)
DecreaseProjectileLimit();
} else if (PlayerAction::Bomb == action) {
CO_Bomb * bomb = new CO_Bomb(&rm->spr_bomb, {ix + HALFPW - 14, iy - 8}, {isFacingRight() ? 3.0f : -3.0f, -3.0f}, 4, globalID, teamID, colorID, RANDOM_INT(120) + 120);
CO_Bomb * bomb = new CO_Bomb(&rm->spr_bomb, Vec2s(ix + HALFPW - 14, iy - 8), Vec2f(isFacingRight() ? 3.0f : -3.0f, -3.0f), 4, globalID, teamID, colorID, RANDOM_INT(120) + 120);

if (AcceptItem(bomb)) {
bomb->owner = this;
Expand Down Expand Up @@ -1671,7 +1671,7 @@ void CPlayer::die(PlayerDeathStyle deathStyle, bool fTeamRemoved, bool fKillCarr

//Drop a shoe item if the player died in one
if (kuriboshoe.is_on()) {
CO_KuriboShoe * shoe = new CO_KuriboShoe(&rm->spr_kuriboshoe, {ix - PWOFFSET, iy - PHOFFSET}, kuriboshoe.getType() == STICKY);
CO_KuriboShoe * shoe = new CO_KuriboShoe(&rm->spr_kuriboshoe, Vec2s(ix - PWOFFSET, iy - PHOFFSET), kuriboshoe.getType() == STICKY);
shoe->collision_detection_checksides();

objectcontainer[1].add(shoe);
Expand Down
4 changes: 2 additions & 2 deletions src/smw/player_components/PlayerSuperStomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ void PlayerSuperStomp::update_onGroundHit(CPlayer &player)
ifSoundOnPlay(rm->sfx_bobombsound);
is_stomping = false;

objectcontainer[1].add(new MO_AttackZone(player.getGlobalID(), player.getTeamID(), {player.leftX() - 32, player.topY() + 10}, {32, 15}, 8, KillStyle::KuriboShoe, false));
objectcontainer[1].add(new MO_AttackZone(player.getGlobalID(), player.getTeamID(), {player.rightX(), player.topY() + 10}, {32, 15}, 8, KillStyle::KuriboShoe, false));
objectcontainer[1].add(new MO_AttackZone(player.getGlobalID(), player.getTeamID(), Vec2s(player.leftX() - 32, player.topY() + 10), Vec2s(32, 15), 8, KillStyle::KuriboShoe, false));
objectcontainer[1].add(new MO_AttackZone(player.getGlobalID(), player.getTeamID(), Vec2s(player.rightX(), player.topY() + 10), Vec2s(32, 15), 8, KillStyle::KuriboShoe, false));
}
}

Expand Down

0 comments on commit 06737bb

Please sign in to comment.