The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I did some @hit stuff, but sphere is still doing it's own
Author Message
bmanny
Apprentice
*

Posts: 25
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2017
Reputation: 0



Post: #4
RE: I did some @hit stuff, but sphere is still doing it's own
Sorry guys. What I posted was pseudo code, not real code.

My question then is... How do I override the ON=@GetHit event for all NPCs? What variable would I need to override to make sure sphere isn't doing it on it's own.

For example. If the only calculation I want to happen is.


On=@hit
apply x damage.

ON=@gethit
Take x damage.



Then, I want to expand to this. I'm not sure if it's best do do all the calculation in On=@gethit or mix it up between the two. It seems more intuitive to have all damage math happen in on=@gethit.

Basically I want this:


Player will have a TAG.SmartDamage

On=@hit
apply x damage


Creature will have a TAG.Toughness

On=@GetHit
local.dmgTest = 0
local.StrengthTest = 0
local.TacticsTest = 0

StrengthTest = src.TAG.SmartDamage - TAG.Toughness

if (StrengthTest <= 0)
StrengthTest = 0

TacticsTest = src.Tactics - Tactics



dmgTest = x(the applied damage from @hit)
dmgTest += (StrengthTest) + TacticsTest

apply dmgTest to create.
(This post was last modified: 05-10-2017 09:50 AM by bmanny.)
05-10-2017 08:56 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: I did some @hit stuff, but sphere is still doing it's own - bmanny - 05-10-2017 08:56 AM

Forum Jump:


User(s) browsing this thread: 3 Guest(s)