- Posts: 937
- Thank you received: 17
new skill
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
4 years 5 months ago - 4 years 5 months ago #8355
by JTP
new skill was created by JTP
Iwe made this, ideas to improve would be nice.
It kinds works, but it also stops when the vict is still attacking, i would like it to come with a message saying It would not be good to let your guard down while fighting. And then let the fight go on.
It should only be possible to stop fighting, when the vict is one of the following states:
#define POS_DEAD 0
#define POS_MORTALLYW 1 <<
#define POS_INCAP 2 <<
#define POS_STUNNED 3 <<
It kinds works, but it also stops when the vict is still attacking, i would like it to come with a message saying It would not be good to let your guard down while fighting. And then let the fight go on.
It should only be possible to stop fighting, when the vict is one of the following states:
#define POS_DEAD 0
#define POS_MORTALLYW 1 <<
#define POS_INCAP 2 <<
#define POS_STUNNED 3 <<
ACMD(do_disengage)
{
struct char_data *vict;
if (GET_POS(ch) < POS_FIGHTING) {
send_to_char(ch, "You are in pretty bad shape, unable to disengage!\r\n");
return;
}
if (!FIGHTING(ch)) {
send_to_char(ch, "How can you disengage from combat, when you are not fighting anyone?\r\n");
return;
}
if (FIGHTING(ch)) {
stop_fighting(ch);
send_to_char(ch, "You disengage from combat, letting your guard down.\r\n");
}
}
Last edit: 4 years 5 months ago by JTP.
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 937
- Thank you received: 17
4 years 5 months ago #8356
by JTP
Replied by JTP on topic new skill
Noone with ideas to improve this ? Seems like a good skill to have
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 818
- Thank you received: 159
4 years 5 months ago #8357
by thomas
You'll want the other combattant to stop fighting, too.
As you see, I'd suggest adding a couple of ticks wait state, and a skill check for this, too.
Replied by thomas on topic new skill
ACMD(do_disengage)
{
struct char_data *vict = FIGHTING(ch);
int percent, prob = GET_SKILL(ch, SKILL_DISENGAGE);
if (IS_NPC(ch) || !prob) {
send_to_char(ch, "You have no idea how.\r\n");
return;
}
if (GET_POS(ch) < POS_FIGHTING) {
send_to_char(ch, "You are in pretty bad shape, unable to disengage!\r\n");
return;
}
if (!vict) {
send_to_char(ch, "How can you disengage from combat, when you are not fighting anyone?\r\n");
return;
}
percent = rand_number(1, 101); /* 101% is a complete failure */
if (percent > prob) {
send_to_char(ch, "PANIC! You failed to disengage!");
} else {
stop_fighting(ch);
if (ch == FIGHTING(vict))
stop_fighting(vict);
}
WAIT_STATE(ch, PULSE_VIOLENCE * 2);
}
As you see, I'd suggest adding a couple of ticks wait state, and a skill check for this, too.
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 937
- Thank you received: 17
4 years 5 months ago #8358
by JTP
Replied by JTP on topic new skill
What i thought was If you tried to disengage and your tagget was not INCAP or STUNNED
Then fighting would continue and you would get a message that it would not be smart....
And If the target was INCAP or STUNNED. Then you could use disengage amd stop fighting.
Then fighting would continue and you would get a message that it would not be smart....
And If the target was INCAP or STUNNED. Then you could use disengage amd stop fighting.
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 818
- Thank you received: 159
4 years 5 months ago #8359
by thomas
Replied by thomas on topic new skill
ok, so you'll need a position check on the vict instead of the skill check.
- percent = rand_number(1, 101); /* 101% is a complete failure */
- if (percent > prob) {
+ if (GET_POSITION(vict) => POS_FIGHTING) {
send_to_char(ch, "You can't disengage, they're fighting back!");
} else {
stop_fighting(ch);
if (ch == FIGHTING(vict))
stop_fighting(vict);
}
WAIT_STATE(ch, PULSE_VIOLENCE * 2);
Please Log in or Create an account to join the conversation.
Time to create page: 0.103 seconds