28 lines
641 B
GDScript
28 lines
641 B
GDScript
extends Skill
|
|
|
|
class_name Arson
|
|
|
|
func _init():
|
|
skillName = "Arson"
|
|
skillIcon = load("res://Skills/Arson/arsonIcon.png")
|
|
|
|
func get_ignition_chance(item:Item):
|
|
return get_ignition_chance_by_stats(item.get_flammability(), item.get_weight())
|
|
|
|
func get_ignition_chance_by_stats(flammability, weight):
|
|
var fireChance = flammability*0.5
|
|
|
|
var addedMassDifficulty = weight
|
|
fireChance -= addedMassDifficulty
|
|
if fireChance < -50:
|
|
fireChance = -50
|
|
|
|
fireChance += currentLevel*1.5
|
|
|
|
var penalty = floor(((50-flammability) - currentLevel)/10)
|
|
if penalty > 0:
|
|
for i in range(penalty):
|
|
fireChance = fireChance * 0.75
|
|
|
|
return fireChance
|