Skip to content
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

Derived Creature DV is incorrect #4

Open
Wreckstation opened this issue Aug 13, 2019 · 7 comments
Open

Derived Creature DV is incorrect #4

Wreckstation opened this issue Aug 13, 2019 · 7 comments

Comments

@Wreckstation
Copy link
Contributor

When DV is specified, it is a sum to the already base 6 DV in addition to agility + spry/tumble. If self.stat_DV_Value is a pointless check because all creatures inherit a base bonus +0 DV. however, in this conditional branch it only returns that bonus without calculating the rest of the agility. (see: cave spider with an DV of 2 in code, but in game has 9 because 6+ 2(bonus) + 1 (agi modifier) )

@Wreckstation Wreckstation self-assigned this Aug 13, 2019
@Wreckstation
Copy link
Contributor Author

This bug also hid the fact that DV needed the sValue as a low-high string, which was changed a while ago to be a raw dice value string for dice tooltip. Not sure how to fix this as my python is not that powerful yet

Wreckstation referenced this issue in TrashMonks/qud-wiki Aug 13, 2019
skill is now named weaponskill to avoid the vague references.
@Wreckstation Wreckstation removed their assignment Aug 30, 2019
@egocarib
Copy link
Member

egocarib commented Sep 2, 2019

Is there something else we wanted to do here yet? Looks pretty good to me after the changes y'all made.

@Wreckstation
Copy link
Contributor Author

I think that it's mostly good aside from stuff like Q Girl having quills and also a body armor that she can't equip, but is calculated anyway. as well as creatures with multiple items for the same slot, so we have to figure out which one is being worn

@egocarib egocarib self-assigned this Sep 3, 2019
@syntaxaire syntaxaire transferred this issue from TrashMonks/qud-wiki Sep 22, 2019
@egocarib
Copy link
Member

egocarib commented Sep 23, 2019

Made some progress with 100d557 the other day (forgot to link the commit).

Going to leave myself assigned for now but not sure if I can work on this for a week or two. If someone else is feeling ambitious before that, just ping me and feel free to do as you will.

syntaxaire added a commit that referenced this issue Oct 11, 2019
@egocarib egocarib removed their assignment Sep 14, 2020
@librarianmage
Copy link
Member

Is this still an issue?

@egocarib
Copy link
Member

egocarib commented May 10, 2022

The calculation we have now is fairly good but it still doesn't really account for all the details that it should. For example, we still don't handle the Q Girl / Quills scenario outlined above properly. The extra logic would mostly need to better take mutations and equipment into account, and would need to be added here:

dv = 6
if self.stat_DV_Value is not None:
dv += int(self.stat_DV_Value)
if self.skill_Acrobatics_Dodge: # the 'Spry' skill
dv += 2
if self.skill_Acrobatics_Tumble: # the 'Tumble' skill
dv += 1
dv += self.attribute_helper_mod('Agility')
applied_body_dv = False
# does this creature have mutations that affect DV?
if self.mutation:
for mutation, info in self.mutation.items():
if mutation == 'Carapace':
dv -= 2
applied_body_dv = True
# does this creature have armor with DV modifiers to add?
if self.inventoryobject:
for name in list(self.inventoryobject.keys()):
if name[0] in '*#@':
# special values like '*Junk 1'
continue
item = self.qindex[name]
if item.dv and (not applied_body_dv or item.wornon != 'Body'):
dv += item.dv

At one point in time, I started writing equipbrain.py to better handle this, but it was never really finished. Finishing that and applying it to creature DV/AV calculations would likely fully resolve this issue.

(whether that is worth the effort is probably up for debate - I haven't felt particularly interested in finishing that module anytime recently - it's a lot of work for probably minimal gain on a few wiki pages where it matters)

@egocarib
Copy link
Member

#18 might be another way to handle this, but that is also a somewhat complicated solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants