New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced Riding fix #228
Advanced Riding fix #228
Changes from all commits
ef190e4
88d6bac
59b7559
8dd7333
3ed7937
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1774,3 +1774,16 @@ bool TBeing::applyTattoo(wearSlotT slot, const sstring & tat, silentTypeT silent | |
} | ||
return FALSE; | ||
} | ||
|
||
bool TBeing::canMeditate() | ||
{ | ||
if (isLinkdead() || (getPosition() < POSITION_RESTING)) | ||
return FALSE; | ||
|
||
if (getPosition() > POSITION_STANDING && | ||
!(getPosition() == POSITION_MOUNTED && | ||
doesKnowSkill(SKILL_ADVANCED_RIDING) && (getSkillValue(SKILL_ADVANCED_RIDING) >= 50))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The doesKnowSkill looks redundant with getSkillValue. Is it possible to have skill value and still not know it? |
||
return FALSE; | ||
} | ||
return TRUE; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,7 +180,7 @@ void TBeing::doPenance() | |
sendTo("You really don't know anything about repenting.\n\r"); | ||
return; | ||
} | ||
if (riding && dynamic_cast<TBeing *>(riding)) { | ||
if ((riding && dynamic_cast<TBeing *>(riding)) && !(doesKnowSkill(SKILL_ADVANCED_RIDING) && (getSkillValue(SKILL_ADVANCED_RIDING) >= 50))){ | ||
sendTo("It is impossible to be repentive while mounted!\n\r"); | ||
return; | ||
} | ||
|
@@ -197,9 +197,14 @@ void TBeing::doPenance() | |
if (task && getPosition() <= POSITION_SITTING) | ||
stopTask(); | ||
|
||
sendTo("You rest and begin to chant.\n\r"); | ||
act("$n sits down in a position of penance.", TRUE, this, 0, 0, TO_ROOM); | ||
setPosition(POSITION_RESTING); | ||
if (!riding) { | ||
sendTo("You rest and begin to chant.\n\r"); | ||
act("$n sits down in a position of penance.", TRUE, this, 0, 0, TO_ROOM); | ||
setPosition(POSITION_RESTING); | ||
} else { | ||
sendTo("You begin to chant.\n\r"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you move your mount while doing penance? |
||
act("$n begins penance.", TRUE, this, 0, 0, TO_ROOM); | ||
} | ||
start_task(this, NULL, NULL, TASK_PENANCE, "", 0, in_room, 1, 0, 40); | ||
} | ||
|
||
|
@@ -231,7 +236,7 @@ void TBeing::doMeditate() | |
sendTo("You really don't know anything about meditating.\n\r"); | ||
return; | ||
} | ||
if (riding && dynamic_cast<TBeing *>(riding)) { | ||
if ((riding && dynamic_cast<TBeing *>(riding)) && !(doesKnowSkill(SKILL_ADVANCED_RIDING) && (getSkillValue(SKILL_ADVANCED_RIDING) >= 50))){ | ||
sendTo("It is impossible to meditate while mounted!\n\r"); | ||
return; | ||
} | ||
|
@@ -252,10 +257,14 @@ void TBeing::doMeditate() | |
} else if (getPosition() <= POSITION_SITTING) | ||
stopTask(); | ||
} | ||
sendTo("You rest and begin to meditate.\n\r"); | ||
act("$n sits down in a position of meditation.", TRUE, this, 0, 0, TO_ROOM); | ||
setPosition(POSITION_SITTING); | ||
|
||
if (!riding) { | ||
sendTo("You rest and begin to meditate.\n\r"); | ||
act("$n sits down in a position of meditation.", TRUE, this, 0, 0, TO_ROOM); | ||
setPosition(POSITION_RESTING); | ||
} else { | ||
sendTo("You begin to meditate.\n\r"); | ||
act("$n begins to meditate.", TRUE, this, 0, 0, TO_ROOM); | ||
} | ||
start_task(this, NULL, NULL, TASK_MEDITATE, "", 0, in_room, 1, 0, 40); | ||
} | ||
|
||
|
@@ -280,7 +289,7 @@ void TBeing::doYoginsa() | |
sendTo("You really don't know anything about meditating.\n\r"); | ||
return; | ||
} | ||
if (riding && dynamic_cast<TBeing *>(riding)) { | ||
if ((riding && dynamic_cast<TBeing *>(riding)) && !(doesKnowSkill(SKILL_ADVANCED_RIDING) && (getSkillValue(SKILL_ADVANCED_RIDING) >= 50))){ | ||
sendTo("It is impossible to meditate while mounted!\n\r"); | ||
return; | ||
} | ||
|
@@ -301,10 +310,14 @@ void TBeing::doYoginsa() | |
} else if (getPosition() <= POSITION_SITTING) | ||
stopTask(); | ||
} | ||
sendTo("You relax and begin meditating.\n\r"); | ||
act("$n sits down and begins meditating.", TRUE, this, 0, 0, TO_ROOM); | ||
setPosition(POSITION_SITTING); | ||
|
||
if (!riding) { | ||
sendTo("You rest and begin to meditate.\n\r"); | ||
act("$n sits down in a position of meditation.", TRUE, this, 0, 0, TO_ROOM); | ||
setPosition(POSITION_RESTING); | ||
} else { | ||
sendTo("You begin to meditate.\n\r"); | ||
act("$n begins to meditate.", TRUE, this, 0, 0, TO_ROOM); | ||
} | ||
start_task(this, NULL, NULL, TASK_YOGINSA, "", 0, in_room, 1, 0, 40); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all these parentheses? We need none of them.