Skip to content
Open
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
3 changes: 3 additions & 0 deletions Underlight/cArts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,10 @@ void cArts::BeginArt(int art_id, bool bypass)
}

if (player->flags & ACTOR_MEDITATING) // expire meditation on evoke
{
player->RemoveTimedEffect(LyraEffect::PLAYER_MEDITATING);
player->SetPPMedSkill(-1);
}

if (!bypass && (player->Skill(art_id) == 0) && (art_id != Arts::GRANT_PPOINT) && (art_id != Arts::DREAMWIDE_EVOKE)) // no chance of success or improvement when skill=0
{
Expand Down
51 changes: 43 additions & 8 deletions Underlight/cPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ bool cPlayer::Update(void)
}
vertical_tilt = (long)vertical_tilt_float;

if ((z > xheight - (.1*physht)) && ((z < xheight + (.1*physht)) || (flags & ACTOR_FLY)) &&
if ((z > xheight - (.1 * physht)) && ((z < xheight + (.1 * physht)) || (flags & ACTOR_FLY)) &&
keyboard[Keystates::JUMP] && move)
{
if (options.network)
Expand All @@ -687,17 +687,33 @@ bool cPlayer::Update(void)
vertforce = -40.0f;
jumped = true;
if (flags & ACTOR_MEDITATING) // expire meditation on jump
{
this->RemoveTimedEffect(LyraEffect::PLAYER_MEDITATING);
cPlayer::SetPPMedSkill(-1);
}
player->PerformedAction();
}

return true;
}

int cPlayer::GetPPMedSkill(void)
{
return med_skill;
}

void cPlayer::SetPPMedSkill(int med_skill)
{
this->med_skill = med_skill;
}

void cPlayer::PerformedAction(void)
{
if (flags & ACTOR_MEDITATING) // expire meditation on move
{
this->RemoveTimedEffect(LyraEffect::PLAYER_MEDITATING);
cPlayer::SetPPMedSkill(-1);
}
if (arts->Casting() || arts->Waiting())
arts->CancelArt();
waving = false;
Expand Down Expand Up @@ -1302,11 +1318,25 @@ void cPlayer::CheckStatus(void)
}
#else // dreamers regen slowly
if (flags & ACTOR_MEDITATING) {
value = 2 + (player->Skill(Arts::MEDITATION) / 10);
// chip at poison
if (flags & ACTOR_POISONED)
timed_effects->expires[LyraEffect::PLAYER_POISONED] -= ((player->Skill(Arts::MEDITATION) / 10) * 20 * 1000); // med plat * 20sec
if ((cPlayer::GetPPMedSkill()) != -1)
{
{
value = 2 + (cPlayer::GetPPMedSkill()) / 10;
// chip at poison
if (flags & ACTOR_POISONED)
timed_effects->expires[LyraEffect::PLAYER_POISONED] -= (((cPlayer::GetPPMedSkill()) / 10) * 20 * 1000); // med plat * 20sec
}
}
else
{
if (flags & ACTOR_MEDITATING) {
value = 2 + (player->Skill(Arts::MEDITATION) / 10);
// chip at poison
if (flags & ACTOR_POISONED)
timed_effects->expires[LyraEffect::PLAYER_POISONED] -= ((player->Skill(Arts::MEDITATION) / 10) * 20 * 1000); // med plat * 20sec

}
}
}
else
value = 1;
Expand Down Expand Up @@ -2993,9 +3023,14 @@ POINT cPlayer::BladePos(void)
int cPlayer::Skill(int art_id)
{
// if it's a PP evoke, return the skill we payed for!
if (pp.in_use && (pp.cursel == GMsg_UsePPoint::USE_ART) &&
(art_id == pp.art_id))
return pp.skill;
if (pp.in_use && (pp.cursel == GMsg_UsePPoint::USE_ART)&&(art_id == pp.art_id))
{
if (pp.art_id == (Arts::MEDITATION))
{
cPlayer::SetPPMedSkill(pp.skill);
}
return pp.skill;
}
#if defined (UL_DEBUG) || defined (GAMEMASTER) // no sphere restrictions in debug builds
return skills[art_id].skill;
#elif PMARE
Expand Down
4 changes: 4 additions & 0 deletions Underlight/cPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class cPlayer : public cActor
enum { INVALID_PLAYERID = -1 };

protected:
int med_skill = -1; // for med pp use
lyra_id_t playerID;
TCHAR upper_name[Lyra::PLAYERNAME_MAX];
LmAvatar avatar;
Expand Down Expand Up @@ -241,6 +242,9 @@ class cPlayer : public cActor

unsigned int GetMonsterType (void);
unsigned int GetTransformedMonsterType (void);

int GetPPMedSkill(void); //lets setup the med_skill geter and setter for pp
void SetPPMedSkill(int med_skill); //lets setup the med_skill geter and setter for pp

bool IsUninitiated(void);
bool IsInitiate(int guild_id=Guild::NO_GUILD);
Expand Down