Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
Bing, AhrefsBot

Members: 0
Guests: 23
Stats
Files
Topics
Posts
Members
Newest Member
489
3,791
19,644
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » General » Coding » show "immune" inste...
Forum Rules | Mark all | Recent Posts

show "immune" instead of "miss"
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 20, 2018 6:24 pm   Last edited Mar 20, 2018 11:24 pm by joeyfogas
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts78
JoinedAug 28, 2016

 
I was wondering if there was a way to set the damage display to show when a victim is immune to an attack instead of a standard "miss" message, so it reads like:

"The ogre is immune to this attack"

instead of:

"You miss the ogre"


I want to add a bit more realism. Even though they both still do -0- damage, hitting someone with something they are immune to isn't technically a miss.

edit: this is for fuss 1.9.2 base

Post is unread #2 Mar 21, 2018 11:56 pm   Last edited Mar 21, 2018 11:58 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts413
JoinedMar 7, 2005

 
joeyfogas said:

I was wondering if there was a way to set the damage display to show when a victim is immune to an attack instead of a standard "miss" message, so it reads like:

"The ogre is immune to this attack"

instead of:

"You miss the ogre"


I want to add a bit more realism. Even though they both still do -0- damage, hitting someone with something they are immune to isn't technically a miss.

edit: this is for fuss 1.9.2 base


If you want to do it right, in my opinion anyway, you should consider adding another damage message that only gets called for immunity cases. This way instead of saying:

"your ", you could have it do something like:

"your slash doesn't even scratch the guard".

Personally I think that's better than just saying they're immune to that particular attack.

It takes a bit more work to do this kind of setup, but my $.02, it is worth it.

Post is unread #3 Mar 25, 2018 9:01 am   
Go to the top of the page
Go to the bottom of the page

Vladaar
Apprentice
GroupMembers
Posts57
JoinedNov 24, 2016

 
Thanks for the idea guys. This is how mine looks now.

A death knight seems unaffected by your attacks.
Seeing a movement of a death knight's shoulders, you bring up your weapon parrying its attack.
Vladaar::[6050/8268hp 2990/2990m 7410/7411mv]


A death knight seems unaffected by your attacks.
You tumble away from a death knight's attack.
Vladaar::[6050/8268hp 2990/2990m 7410/7411mv]

You find a weakness in your foe's armor.
Your attack strikes a death knight's shield.

Post is unread #4 Mar 25, 2018 10:23 pm   
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts78
JoinedAug 28, 2016

 
i'd love to see how you set that up

Post is unread #5 Mar 25, 2018 11:14 pm   Last edited Mar 25, 2018 11:15 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts413
JoinedMar 7, 2005

 
The only issue I really have with a generic message is that you can't readily tell which of your attacks the target is immune to. If I'm dual wielding an axe and a hammer, say slashing and crushing weapons respectively, it would be nice to infer from the messages that one is not effective while the other is, in case I have something else to switch to. Simply telling me that they seem unaffected by my attack is not helpful in that regard, nor is telling me that my attack did damage, but not which attack or what type it was.

That was the rationale for me modifying the existing system, because that was one thing I liked about it. Hope that makes sense?

Post is unread #6 Mar 25, 2018 11:22 pm   
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts78
JoinedAug 28, 2016

 
how did you set that up to where it only gets called in immunity cases? and where in fight.c did you stick it? lol

Post is unread #7 Mar 25, 2018 11:43 pm   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts413
JoinedMar 7, 2005

 

joeyfogas said:

how did you set that up to where it only gets called in immunity cases? and where in fight.c did you stick it? lol


It's been a while, and it was somewhat onerous. There are (were?) arrays for all the damage severity messages for each type (things like "decimates", "mutilates", "destroys" the victim) in const.c, so start there and see if you can follow how that works before tinkering with it.

What I basically changed was to add a damage type between "misses" and "barely scratches", for example, so you have misses/doesn't even scratch/barely scratches/etc.

From there, you have to somehow flag damages so you can purposely retrieve the "immunity" message vs. any other array position. If you look in the new_dam_message( ) I think you can find the section where it figures out which severity of damage message to pull from the array. There should be a comment to the effect of "get the damage index" and after that, "Lookup the damage message" in there somewhere. You can see the if/else-if logic for figuring out when to get the "miss" text and when to fetch some kind of hit. I think what I did was pass a special value to the damage message function, something like dam = -1, so that I could force it to pick out a specific immunity message (say, array position 1, whereas miss is array position 0).

Hopefully that helps? There's more to it, but that's probably too implementation specific and not likely to help you. But for the general idea of how to do this, that's where you want to start. It was a very messy thing but as I said, it was worth the hassle to finally work it out. There might be a better way too, but you'll have to start from the same place regardless, so hopefully this helps?



Post is unread #8 Mar 25, 2018 11:53 pm   
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts78
JoinedAug 28, 2016

 
it does. Since I am only a code manipulator and not a true coder, this actually helps a great deal. appreciate the rundown.

Bonus points if someone makes a snippet :)

Pages:<< prev 1 next >>