Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

IPlayer.DealDamage(float damage, DamageType type)

Here you can find ScriptAPI suggestions implemented in the game.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
Danger Ross
Superfighter
Superfighter
Posts: 151
Joined: Thu Mar 31, 2016 12:56 am
Title: Dangerous
SFD Alias: Danger Ross
Started SFD: 14 june 2012 (launch day)
Location: California
Gender:
Age: 22

IPlayer.DealDamage(float damage, DamageType type)

Post by Danger Ross » Sun Mar 22, 2020 4:49 am

I've been able to work around the fact that I can't make artificial damage (damage done through script) by setting the players health to some amount below their current health, but after the strength boost was added with its unique "boost health" mechanic, I realized there's some limitations to this method. There's no way to deal artificial damage to someone who only has boost health left since there's no method of interacting with it. Also, the workaround doesn't allow me to keep track of damage statistics as easily.

I propose a script-friendly method that allows the user to deal damage to players artificially in a very simple layout. Let's call this method "DealDamage"
the first parameter "damage" (float type) would indicate the amount of health to be subtracted from the player's current health, as well as an amount to be added to the player's statistics. The property that would be modified in statistics may depend on the DamageType, but by default it should at least add to IPlayerStatistics.TotalOtherDamageTaken and IPlayerStatistics.TotalDamageTaken.
The DamageType enum would indicate which playermodifier will alter the effect of the inputted damage value, as well as which player statistics will be modified.

If it's not possible to add a method like this, then at least consider making it possible to alter IPlayerStatistics properties and changing BoostHealth.
2 x
sorry bucko, you can't punch with swords 8-)

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 32

Post by Gurt » Sun Mar 22, 2020 12:40 pm

Adding IPlayer.DealDamage(float damage) after v.1.3.4. It will only contribute to the TotalOtherDamageTaken but will follow all the internal rules for dealing damage to a player.
0 x
Gurt

Locked