Talk:Item Stat Modifiers

From 7 Days to Die Wiki
Jump to navigation Jump to search
Damage Comparison
Quality Pummel Pete Level Nomad Adventurer
Q1 0 13 20
Q1 1 15 22
Q1 2 16 24
Q1 3 17 26
Q1 4 19 28
Q1 5 20 30
Q2 0 15 22
Q2 1 16 24
Q2 2 17 26
Q2 3 19 28
Q2 4 20 30
Q2 5 22 33
Q3 0 16 24
Q3 1 17 26
Q3 2 19 28
Q3 3 20 30
Q3 4 22 33
Q3 5 23 34
Q4 0 17 26
Q4 1 19 28
Q4 2 20 30
Q4 3 22 33
Q4 4 23 34
Q4 5 24 36
Q5 0 19 28
Q5 1 20 30
Q5 2 22 33
Q5 3 23 34
Q5 4 24 36
Q5 5 26 39
Q6 0 20 30
Q6 1 22 33
Q6 2 23 34
Q6 3 24 36
Q6 4 26 39
Q6 5 27 40

After much trial and error, my current theory is that the code works like this: I still need to figure out how player and zombie armor works, and I need to do physical testing for modpower.

#include <iostream>

using namespace std;

int main()
{
    //driver variables
    int qualLevel = 1;
    int perkLevel = 5;
    
    
    float base = 13.8;
    float qualitymod = 0.1*qualLevel-0.1;
    float perkmod = 0.1*perkLevel;
    float difficultymod = 1.5;
    
    int mod1 = base * (1+qualitymod+perkmod);
    
    int finaldamage = mod1 * difficultymod;
    
    cout << finaldamage;

    return 0;
}

As you can see, mod1 and finaldamage are ints, so the expressions that evaluate to those variables have their decimal values dropped, which is a standard feature in C languages. The computer doesn't know what to do with decimals so it just reads the int and drops the rest of the data.