mob
var
Stats
Health
New()
..()
Health = new(100)
Stats
var
Value = 0
maxValue = 0
New(n)
if(n)
Value = n
maxValue = n
proc
Add(n)
Value = min(max(Value+n,1),maxValue)
obj/Jutsu/Sand_Manipulator
icon = 'Sand Manipulator Jutsu.dmi'
Sand_Tsunami
icon_state = "Sand Tsunami"
density = 1
Bump(atom/A)
var/mob/O = Owner
if(ismob(A))
var/mob/M = A
var/dmg = O.Ninjutsu.Value*O.sandTsun
M.Health.Add(-dmg)
O.Dmg_Text(M,dmg,"Sand Tsunami")
Problem description:
Okay I read the whole guide thing on datums and I came up with a system like that. I figured I could use the Add() datum proc for subtraction as well. However when the obj bumps into a mob, it gives me the following runtime error.
runtime error: Cannot execute null.Add().
proc name: Bump (/obj/Jutsu/Sand_Manipulator/Sand_Tsunami/Bump)
usr: 0
src: Sand Tsunami (/obj/Jutsu/Sand_Manipulator/Sand_Tsunami)
call stack:
Sand Tsunami (/obj/Jutsu/Sand_Manipulator/Sand_Tsunami): Bump(Sand Clone (/mob/Clones/Sand_Clone))
Sand Tsunami (/obj/Jutsu/Sand_Manipulator/Sand_Tsunami): Move(Grass1 (9,4,1) (/turf/Terrains/Grass1), 8)
How is it null when I have it M.Health.Add()?
Health = new