Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 13, 2017, 06:57   #1
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
4.0.5 device skill effect

I'm trying 4.0.5 in the comp, and when I inspect devices I see mention of increased damage due to device skill. When I use the items, I don't observe the increases. E.g. I just used a wand of dragon flame 200 +58% on a demonic Q avg 420 and did 4 *s of damage.

Could the Q have 600+ hp?

Does device skill affect damage?
PowerDiver is offline   Reply With Quote
Old January 13, 2017, 12:54   #2
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,051
PowerWyrm is on a distinguished road
It would be nice to have damage output displayed for spells the same way there's damage output displayed for melee/missiles.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old January 13, 2017, 13:30   #3
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,449
Ingwe Ingweron is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
It would be nice to have damage output displayed for spells the same way there's damage output displayed for melee/missiles.
See Nick's answer when I asked this question some time ago. http://angband.oook.cz/forum/showpos...&postcount=401

Essentially, imagine a ball or beam spell. How do you display the damage when it hits multiple monsters?
__________________
“We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.”
― Tom Stoppard, Rosencrantz and Guildenstern are Dead
Ingwe Ingweron is offline   Reply With Quote
Old January 13, 2017, 18:35   #4
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,304
Donated: $40
Pete Mack is on a distinguished road
Display the damage at the target. If there's no selected target, display no damage.
Pete Mack is offline   Reply With Quote
Old January 13, 2017, 19:06   #5
Pondlife
Apprentice
 
Join Date: Mar 2010
Location: UK
Posts: 57
Pondlife is on a distinguished road
That sounds similar to what was reported in this post:

http://angband.oook.cz/forum/showpos...&postcount=174

That was in 4.0.4.
__________________
Playing roguelikes on and off since 1984.
rogue, hack, moria, nethack, angband & zangband.
Pondlife is offline   Reply With Quote
Old January 13, 2017, 20:01   #6
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
Quote:
Originally Posted by Pondlife View Post
That sounds similar to what was reported in this post:

http://angband.oook.cz/forum/showpos...&postcount=174

That was in 4.0.4.
Thanks. That's what I was expecting, but it is nice to get confirmation.

It would be even better if there was an announcement this was done on purpose. I've never liked the device skill damage modifier.

If any of the dev team ever look at my spell code and think I've lost my mind, one of the reasons for my architecture was to make bugs like this impossible.
PowerDiver is offline   Reply With Quote
Old January 13, 2017, 22:12   #7
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,641
Donated: $60
Nick is on a distinguished road
The damage boost is indeed applied:
Code:
	if (use_boost)
		final *= (100 + context->boost) / 100;
So if (your device skill - your level) is greater than 100, your damage is doubled, otherwise nothing happens.

I'll fix that shortly. As to the question of whether it should be there, I'll probably leave that to the player/race/class shakeup in 4.2.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old January 13, 2017, 23:22   #8
Pondlife
Apprentice
 
Join Date: Mar 2010
Location: UK
Posts: 57
Pondlife is on a distinguished road
Quote:
Originally Posted by Nick View Post
The damage boost is indeed applied:
Code:
	if (use_boost)
		final *= (100 + context->boost) / 100;
If both sides of that division are integer, you'll end up with integer division. That's rarely what you want (e.g. 10/3 = 3). I'd normally force something to be float or double, e.g:

final *= (100.0 + context->boost) / 100.0;

Note that I know nothing about the Angband source; so I may well be talking out of my backside. But I've been burnt by integer division in C before so I thought I'd mention it.
__________________
Playing roguelikes on and off since 1984.
rogue, hack, moria, nethack, angband & zangband.
Pondlife is offline   Reply With Quote
Old January 13, 2017, 23:27   #9
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,017
Derakon is on a distinguished road
Quote:
Originally Posted by Pondlife View Post
If both sides of that division are integer, you'll end up with integer division. That's rarely what you want (e.g. 10/3 = 3). I'd normally force something to be float or double, e.g:

final *= (100.0 + context->boost) / 100.0;

Note that I know nothing about the Angband source; so I may well be talking out of my backside. But I've been burnt by integer division in C before so I thought I'd mention it.
Yeah, that should be written as
Code:
final = (final * (100 + context->boost)) / 100;
It's important that we do all multiplications before we do any divisions, or else we'll only ever be multiplying by 1 or, rarely, 2 (if context->boost >= 100).
Derakon is offline   Reply With Quote
Old January 13, 2017, 23:34   #10
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,641
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Pondlife View Post
If both sides of that division are integer, you'll end up with integer division. That's rarely what you want (e.g. 10/3 = 3). I'd normally force something to be float or double, e.g:

final *= (100.0 + context->boost) / 100.0;
The thing is that most things in Angband are integers - HP, XP, etc - so it's usually cleanest to just keep everything as integers and be careful with what that means.

The fix in this case was
Code:
	final *= (100 + context->boost);
	final /=  100;
which keeps full precision for as long as possible, so we're rounding down to the nearest hitpoint (as we want to) rather than to an integer multiple of the original damage (which is just silly).
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FA] How do I activate Warrior Probe skill? Ingwe Ingweron Variants 2 November 17, 2014 07:11
[BUG] Getting a skill for 0 XP Stone Dog Sil 2 December 9, 2013 00:04
Magic Device Skill Old Coach v4 1 January 23, 2012 23:05
Gadgeteer skill in steamband UglySquirrell Variants 2 October 14, 2011 04:06
New spell / skill dhegler Vanilla 3 May 21, 2010 21:36


All times are GMT +1. The time now is 03:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.