Skip to content

Commit

Permalink
Merge pull request #869 from WALLOFJUSTICE/dev23-q4
Browse files Browse the repository at this point in the history
* V4.3.1
  • Loading branch information
WALLOFJUSTICE authored Dec 12, 2024
2 parents 0251595 + 546c80a commit 7f49b08
Show file tree
Hide file tree
Showing 48 changed files with 9,453 additions and 712 deletions.
71 changes: 70 additions & 1 deletion lang/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6540,5 +6540,74 @@ Unlock Achievements to earn more!#
6309 You are blasted by a torrent!#
6310 Quick Turn Speed#
6311 Affect the horizontal speed of the Quick Turn action.#
6312 BACK#
6313 FACE#
6314 NECK#
6315 RING#
6316 Claim#
6317 Already Claimed#
6318 No Items To Claim#
6319 CHANGE TO:
#
6320 CURRENT: #
6321 ITEMS#
6322 RACE#
6323 CLASS#
6324 ASSIST ITEM SELECTION#
6325 RACE SELECTION#
6326 CLASS SELECTION#
6327 CHANGING TO: #
6328 Assistance:#
6329 Score Penalty:#
6330 Achievements:#
6331 ENABLED#
6332 DISABLED#
6333 Class choice has reset
due to selected race.#
6334 Character Changed#
6335 Changes will be applied
on next game start.#
6336 %s has changed their character for next game start.
(%s %s)#
6337 Sending to server...#
6338 Invalid Class!#
6339 Take up to four gifts to ease
the adventure that awaits.

Each point of Assistance reduces
the party's final score ranking.#
6340 ASSIST ITEMS#
6341 You were Assisted. (%d Pts)#
6342 Assist Items#
6343 Allows claiming items from the starting floor Assist Shrine to adjust difficulty.#
6344 Enable Assist Items#
6345 Assist Items enabled#
6346 Assist Items are disabled#
6347 Take up to four gifts to ease
the adventure that awaits.

Assist Items are disabled in Game
Settings. Toggle the option on to
use Assist Items.

#
6348 Take up to four gifts to ease
the adventure that awaits.

6350 END#
Assist Items are disabled in Game
Settings. Send a request to the
Host to enable the game setting.

#
6349 Request Assist Items#
6350 View Game Settings#
6351 The shrine is currently in use by someone else.#
6352 You see an Assist shrine.#
6353 Assist shrine#
6354 Use Assist shrine#
6355 Your character has changed for next game start.
(%s %s)#
6356 You claim %d Assistance points from the shrine.#
6357 %s claims %d Assistance points from the Assist shrine.#

6399 END#
12 changes: 12 additions & 0 deletions lang/item_names.json
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,18 @@
"hat_hood_whispers": {
"name_identified": "hood of whispers",
"name_unidentified": "hood"
},
"ring_resolve": {
"name_identified": "ring of resolve",
"name_unidentified": "ring"
},
"cloak_guardian": {
"name_identified": "cloak of the guardian",
"name_unidentified": "cloak"
},
"mask_marigold": {
"name_identified": "marigold",
"name_unidentified": "marigold"
}
},
"spell_names": {
Expand Down
2 changes: 1 addition & 1 deletion src/actarrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ void actArrow(Entity* my)
{
if ( parent->behavior == &actArrowTrap )
{
trapResist = hit.entity->getFollowerBonusTrapResist();
trapResist = hit.entity->getEntityBonusTrapResist();
if ( trapResist != 0 )
{
real_t mult = std::max(0.0, 1.0 - (trapResist / 100.0));
Expand Down
6 changes: 5 additions & 1 deletion src/actboulder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ bool doesEntityStopBoulder(Entity* entity)
{
return true;
}
else if ( entity->behavior == &::actAssistShrine )
{
return true;
}
return false;
}

Expand Down Expand Up @@ -249,7 +253,7 @@ int boulderCheckAgainstEntity(Entity* my, Entity* entity, bool ignoreInsideEntit
damage = 50;
}

int trapResist = entity->getFollowerBonusTrapResist();
int trapResist = entity->getEntityBonusTrapResist();
if ( trapResist != 0 )
{
real_t mult = std::max(0.0, 1.0 - (trapResist / 100.0));
Expand Down
2 changes: 1 addition & 1 deletion src/actgeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3714,7 +3714,7 @@ int getBellDmgOnEntity(Entity* entity)
}

int damage = 80;
int trapResist = entity->getFollowerBonusTrapResist();
int trapResist = entity->getEntityBonusTrapResist();
if ( trapResist != 0 )
{
real_t mult = std::max(0.0, 1.0 - (trapResist / 100.0));
Expand Down
2 changes: 2 additions & 0 deletions src/acthudweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3309,6 +3309,7 @@ void actHudShield(Entity* my)
if (stats[HUDSHIELD_PLAYERNUM]->HP <= 0)
{
my->flags[INVISIBLE] = true;
my->flags[INVISIBLE_DITHER] = false;
return;
}
}
Expand Down Expand Up @@ -4083,6 +4084,7 @@ void actHudAdditional(Entity* my)
if ( stats[HUDSHIELD_PLAYERNUM]->HP <= 0 )
{
my->flags[INVISIBLE] = true;
my->flags[INVISIBLE_DITHER] = false;
return;
}
}
Expand Down
238 changes: 238 additions & 0 deletions src/actmagictrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,4 +868,242 @@ void Entity::actDaedalusShrine()
}
}
}
}

void actAssistShrine(Entity* my)
{
if ( !my )
{
return;
}

my->actAssistShrine();
}

void Entity::actAssistShrine()
{
if ( this->ticks == 1 )
{
this->createWorldUITooltip();
}

this->removeLightField();
#ifdef USE_FMOD
if ( shrineAmbience == 0 )
{
shrineAmbience--;
stopEntitySound();
entity_sound = playSoundEntityLocal(this, 149, 16);
}
if ( entity_sound )
{
bool playing = false;
entity_sound->isPlaying(&playing);
if ( !playing )
{
entity_sound = nullptr;
}
}
#else
shrineAmbience--;
if ( shrineAmbience <= 0 )
{
shrineAmbience = TICKS_PER_SECOND * 30;
playSoundEntityLocal(this, 149, 16);
}
#endif

if ( !shrineInit )
{
shrineInit = 1;
}

Sint32& shrineInteracting = this->skill[0];

Uint32 numFlames = 0;
Uint32 redFlames = 0;
Entity* interacting = uidToEntity(shrineInteracting);
if ( interacting && interacting->behavior == &actPlayer )
{
redFlames |= (1 << interacting->skill[2]);
numFlames |= (1 << interacting->skill[2]);
}
for ( int i = 0; i < MAXPLAYERS; ++i )
{
if ( !client_disconnected[i] )
{
if ( stats[i]->MISC_FLAGS[STAT_FLAG_ASSISTANCE_PLAYER_PTS] > 0 )
{
numFlames |= (1 << i);
}
}
}

static ConsoleVariable<float> cvar_assist_flame_x1("/assist_flame_x1", 0.5);
static ConsoleVariable<float> cvar_assist_flame_y1("/assist_flame_y1", -3.f);
static ConsoleVariable<float> cvar_assist_flame_x2("/assist_flame_x2", -1.f);
static ConsoleVariable<float> cvar_assist_flame_y2("/assist_flame_y2", -1.f);
static ConsoleVariable<float> cvar_assist_flame_x3("/assist_flame_x3", -1.f);
static ConsoleVariable<float> cvar_assist_flame_y3("/assist_flame_y3", -3.5);
static ConsoleVariable<float> cvar_assist_flame_x4("/assist_flame_x4", 0.5);
static ConsoleVariable<float> cvar_assist_flame_y4("/assist_flame_y4", -1.f);
static ConsoleVariable<float> cvar_assist_flame_z1("/assist_flame_z1", 6.5);
static ConsoleVariable<float> cvar_assist_flame_z2("/assist_flame_z2", 9.f);
static ConsoleVariable<float> cvar_assist_flame_z3("/assist_flame_z3", 6.5);
static ConsoleVariable<float> cvar_assist_flame_z4("/assist_flame_z4", 10.f);
if ( numFlames > 0 )
{
Entity* entity = nullptr;
if ( numFlames & (1 << 3) )
{
if ( entity = spawnFlame(this, redFlames & (1 << 3) ? SPRITE_FLAME : SPRITE_CRYSTALFLAME) )
{
entity->x += *cvar_assist_flame_x4 * cos(this->yaw);
entity->y += *cvar_assist_flame_x4 * sin(this->yaw);
entity->x += *cvar_assist_flame_y4 * cos(this->yaw + PI / 2);
entity->y += *cvar_assist_flame_y4 * sin(this->yaw + PI / 2);
entity->z -= *cvar_assist_flame_z4;
entity->flags[GENIUS] = false;
entity->setUID(-3);
}
}
if ( numFlames & (1 << 2) )
{
if ( entity = spawnFlame(this, redFlames & (1 << 2) ? SPRITE_FLAME : SPRITE_CRYSTALFLAME) )
{
entity->x += *cvar_assist_flame_x3 * cos(this->yaw);
entity->y += *cvar_assist_flame_x3 * sin(this->yaw);
entity->x += *cvar_assist_flame_y3 * cos(this->yaw + PI / 2);
entity->y += *cvar_assist_flame_y3 * sin(this->yaw + PI / 2);
entity->z -= *cvar_assist_flame_z3;
entity->flags[GENIUS] = false;
entity->setUID(-3);
}
}
if ( numFlames & (1 << 1) )
{
if ( entity = spawnFlame(this, redFlames & (1 << 1) ? SPRITE_FLAME : SPRITE_CRYSTALFLAME) )
{
entity->x += *cvar_assist_flame_x2 * cos(this->yaw);
entity->y += *cvar_assist_flame_x2 * sin(this->yaw);
entity->x += *cvar_assist_flame_y2 * cos(this->yaw + PI / 2);
entity->y += *cvar_assist_flame_y2 * sin(this->yaw + PI / 2);
entity->z -= *cvar_assist_flame_z2;
entity->flags[GENIUS] = false;
entity->setUID(-3);
}
}
if ( numFlames & (1 << 0) )
{
if ( entity = spawnFlame(this, redFlames & (1 << 0) ? SPRITE_FLAME : SPRITE_CRYSTALFLAME) )
{
entity->x += *cvar_assist_flame_x1 * cos(this->yaw);
entity->y += *cvar_assist_flame_x1 * sin(this->yaw);
entity->x += *cvar_assist_flame_y1 * cos(this->yaw + PI / 2);
entity->y += *cvar_assist_flame_y1 * sin(this->yaw + PI / 2);
entity->z -= *cvar_assist_flame_z1;
entity->flags[GENIUS] = false;
entity->setUID(-3);
}
}

if ( redFlames )
{
this->light = addLight(this->x / 16, this->y / 16, "assist_shrine_red");
}
else
{
std::string lightname = "assist_shrine_flame";
int flames = 0;
for ( int i = 0; i < MAXPLAYERS; ++i )
{
if ( numFlames & (1 << i) )
{
++flames;
}
}
lightname += std::to_string(std::min(MAXPLAYERS, flames));
this->light = addLight(this->x / 16, this->y / 16, lightname.c_str());
}
}
else
{
this->light = addLight(this->x / 16, this->y / 16, "assist_shrine");
}

if ( multiplayer == CLIENT )
{
return;
}

if ( shrineInteracting > 0 )
{
if ( !interacting || (entityDist(interacting, this) > TOUCHRANGE) )
{
int playernum = -1;
if ( interacting->behavior == &actPlayer )
{
playernum = interacting->skill[2];
}
shrineInteracting = 0;
serverUpdateEntitySkill(this, 0);
if ( multiplayer == SERVER && playernum > 0 )
{
strcpy((char*)net_packet->data, "ASCL");
net_packet->data[4] = playernum;
SDLNet_Write32(this->getUID(), &net_packet->data[5]);
net_packet->address.host = net_clients[playernum - 1].host;
net_packet->address.port = net_clients[playernum - 1].port;
net_packet->len = 9;
sendPacketSafe(net_sock, -1, net_packet, playernum - 1);
}
else if ( multiplayer == SINGLE || playernum == 0 )
{
GenericGUI[playernum].assistShrineGUI.closeAssistShrine();
}
}
}

// using
for ( int i = 0; i < MAXPLAYERS; i++ )
{
if ( selectedEntity[i] == this || client_selected[i] == this )
{
if ( inrange[i] && players[i]->entity )
{
if ( shrineInteracting != 0 )
{
if ( Entity* interacting = uidToEntity(shrineInteracting) )
{
if ( interacting != players[i]->entity )
{
messagePlayer(i, MESSAGE_INTERACTION, Language::get(6351));
}
}
}
else
{
shrineInteracting = players[i]->entity->getUID();
if ( multiplayer == SERVER )
{
serverUpdateEntitySkill(this, 0);
}
if ( players[i]->isLocalPlayer() )
{
GenericGUI[i].openGUI(GUI_TYPE_ASSIST, this);
}
else if ( multiplayer == SERVER && i > 0 )
{
strcpy((char*)net_packet->data, "ASSO");
SDLNet_Write32(this->getUID(), &net_packet->data[4]);
net_packet->address.host = net_clients[i - 1].host;
net_packet->address.port = net_clients[i - 1].port;
net_packet->len = 8;
sendPacketSafe(net_sock, -1, net_packet, i - 1);
}
}
break;
}
}
}
}
Loading

0 comments on commit 7f49b08

Please sign in to comment.