Skip to content

Commit

Permalink
Merge pull request #596 from WALLOFJUSTICE/dev-20-merge-main-menu
Browse files Browse the repository at this point in the history
Skills menu + merged settings
  • Loading branch information
WALLOFJUSTICE authored Nov 5, 2021
2 parents 0308e6b + cabce4e commit d9a18b7
Show file tree
Hide file tree
Showing 55 changed files with 6,509 additions and 661 deletions.
30 changes: 23 additions & 7 deletions lang/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,13 @@ thou makest use of them.#

# skill levels

363 none#
364 novice#
365 basic#
366 skilled#
367 expert#
368 master#
369 legend#
363 None#
364 Novice#
365 Basic#
366 Skilled#
367 Expert#
368 Master#
369 Legend#


# rest of the character sheet
Expand Down Expand Up @@ -5995,5 +5995,21 @@ Changing this gameflag is disabled in current game mode.#
4047 No interactions available#
4048 You don't feel like yourself.#
4049 Quick-cast#
4050 Grab#
4051 Level %d#
4052 Floor %d#
4053 Close#
4054 Next Page#
4055 Previous Page#
4056 LEGEND BONUS#
4057 None#
4058 All items#
4059 2 Metal
/ 0 Magic#
4060 1 Metal
/ 0 Magic#
4061 Tier#
4062 Scroll up/down#
4063 Scroll#

4099 end#
114 changes: 114 additions & 0 deletions src/actgeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "interface/interface.hpp"
#include "items.hpp"
#include "scores.hpp"
#include "mod_tools.hpp"

/*-------------------------------------------------------------------------------
Expand Down Expand Up @@ -384,6 +385,119 @@ void Entity::actStalagColumn()

}

void actStatue(Entity* my)
{
if ( my->statueInit == 0 && StatueManager.allStatues.size() > 0 )
{
// needs to init.
if ( StatueManager.allStatues.find(my->statueId) != StatueManager.allStatues.end() )
{
my->statueInit = 1;
if ( my->statueDir >= 0 && my->statueDir < StatueManager.directionKeys.size() )
{
int index = 0;
real_t baseHeight = 0.0;
std::string directionString = StatueManager.directionKeys[my->statueDir];
for ( auto& limb : StatueManager.allStatues[my->statueId].limbs[directionString] )
{
Entity* childEntity = newEntity(limb.sprite, 1, map.entities, nullptr);
childEntity->parent = my->getUID();
childEntity->x = my->x - limb.x;
childEntity->y = my->y - limb.y;
childEntity->z = limb.z + StatueManager.allStatues[my->statueId].heightOffset;
childEntity->focalx = limb.focalx;
childEntity->focaly = limb.focaly;
childEntity->focalz = limb.focalz;
childEntity->pitch = limb.pitch;
childEntity->roll = limb.roll;
childEntity->yaw = limb.yaw;
childEntity->flags[PASSABLE] = true;
childEntity->grayscaleGLRender = 1.0;
node_t* tempNode = list_AddNodeLast(&my->children);
tempNode->element = childEntity; // add the node to the children list.
tempNode->deconstructor = &emptyDeconstructor;
tempNode->size = sizeof(Entity*);
++index;
}
}
}
}
}

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

if ( StatueManager.processStatueExport() == 1 ) // in progress
{
if ( Entity* player = uidToEntity(StatueManager.editingPlayerUid) )
{
player->yaw += PI / 2;
while ( player->yaw >= 2 * PI )
{
player->yaw -= 2 * PI;
}
}
}

for ( int i = 0; i < MAXPLAYERS; i++ )
{
if ( (i == 0 && selectedEntity[0] == my) || (client_selected[i] == my) || (splitscreen && selectedEntity[i] == my) )
{
if ( inrange[i] )
{
if ( !StatueManager.activeEditing )
{
StatueManager.statueEditorHeightOffset = 0.0;
}
StatueManager.activeEditing = !StatueManager.activeEditing;
messagePlayer(0, "Statue editing mode: %d", StatueManager.activeEditing);

my->skill[0] = StatueManager.activeEditing ? 1 : 0;
}
}
}

if ( StatueManager.activeEditing )
{
if ( !players[1]->entity )
{
client_disconnected[1] = false;
Entity* entity = newEntity(0, 1, map.entities, nullptr);
entity->behavior = &actPlayer;
entity->addToCreatureList(map.creatures);

entity->x = my->x;
entity->y = my->y;
entity->z = my->z;

entity->z -= 15 + StatueManager.statueEditorHeightOffset;
entity->focalx = limbs[HUMAN][0][0]; // 0
entity->focaly = limbs[HUMAN][0][1]; // 0
entity->focalz = limbs[HUMAN][0][2]; // -1.5
entity->sprite = 113; // head model
entity->sizex = 4;
entity->sizey = 4;
entity->flags[GENIUS] = true;
entity->flags[BLOCKSIGHT] = true;
entity->flags[PASSABLE] = true;
entity->skill[2] = 1; // skill[2] == PLAYER_NUM
players[1]->entity = entity;
StatueManager.editingPlayerUid = entity->getUID();
}
else
{
players[1]->entity->x = my->x;
players[1]->entity->y = my->y;
players[1]->entity->z = my->z;
players[1]->entity->z -= 15 + StatueManager.statueEditorHeightOffset;
}
}
}

void actColumn(Entity* my)
{
//TODO: something?
Expand Down
Loading

0 comments on commit d9a18b7

Please sign in to comment.