Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Bing

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
640
KieraZajac
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » show "immune" instead of "mis...
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, 4:24 pm   Last edited Mar 20, 2018, 9:24 pm by joeyfogas
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts77
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, 9:56 pm   Last edited Mar 21, 2018, 9:58 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts396
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 <slash/slice/crush/pound/etc.> <misses/hits/mutilates/maims/etc.> <target's name>", 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, 7:01 am
Go to the top of the page
Go to the bottom of the page

Vladaar
Fledgling
GroupMembers
Posts44
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]
<T:Vladaar TC: Some Cuts E: a death knight EC: Slightly Scratched>

A death knight seems unaffected by your attacks.
You tumble away from a death knight's attack.
Vladaar::[6050/8268hp 2990/2990m 7410/7411mv]
<T:Vladaar TC: Some Cuts E: a death knight EC: Slightly Scratched>
You find a weakness in your foe's armor.
Your attack strikes a death knight's shield.
       
Post is unread #4 Mar 25, 2018, 8:23 pm
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts77
JoinedAug 28, 2016

i'd love to see how you set that up
       
Post is unread #5 Mar 25, 2018, 9:14 pm   Last edited Mar 25, 2018, 9:15 pm by GatewaySysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts396
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, 9:22 pm
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts77
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, 9:43 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts396
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, 9:53 pm
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts77
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 >>