Coder Social home page Coder Social logo

Comments (6)

Jhobean avatar Jhobean commented on May 28, 2024

Similar fix with stam/hits/mana
#625

from source-x.

drk84 avatar drk84 commented on May 28, 2024

It's not a similar fix, the difference is that modstats can go below 0 while the related stats no.

This bring the following issue:

ON=@equip
src.modstr -50
ON=@Unequip
src.modtr 50

Currently a character with 40 str equipping this item will go below 0 and thus it will get a 65k value of str.

If we internally add a check that avoid a mod value to bring the main stat below 0, the player Unequipping the item will get a 50 str value instead of his original 40 value.

That's because, unlike spells stat modifier, modStats modifier are not tracked anywhere.

So the best solution for me is that the scripter is responsible to check if a modStat will bring the stat below 0. (It's a simple script)

Example:
//Argn1: ModStr value
[FUNCTION setModStr]
if (<tag0.override.modstr>)
	modstr -= <tag0.override.modstr>
	tag.override.modstr = 
	return 
endif
if ((<str> + <argn1>) < 0)
	argn1 = -<str>
	tag.override.modstr += <argn1>
	sysmessage @50 Modstr overrided to <argn1>  
endif
modstr <argn1>

from source-x.

Jhobean avatar Jhobean commented on May 28, 2024

Seem legit to me. Tag.override.modstr wiil be a custom modstr only in script side?

from source-x.

drk84 avatar drk84 commented on May 28, 2024

yes

from source-x.

Tolokio avatar Tolokio commented on May 28, 2024
on=@statchange
if <argn1> <= 2 //if str dex or int
    if <argn3> <= 0 //if new value will be negative or 0
        argn3=1 
    endif
endif

I think this or something like this is the best way to fix it.
When items get unequiped, str will be reset as modstr + ostr, so no need to store anything at any tag.
I think this simple check could be added to source. The question would be the limit. 0 or 1?

from source-x.

cbnolok avatar cbnolok commented on May 28, 2024

That should be double checked, then if there's still overflow, the wisest thing would be only to limit the stat to 0 before overflowing

from source-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.