Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function echidna.addAff(aff)
- if not echidna.affdict[aff] then if debug() then output("DEBUG: affliction is not in the dictionary.") end return false end
- local function addToAffList(affliction,type)
- if not echidna[type.."affs"] then echidna[type.."affs"] = {} end
- for k,v in pairs(echidna[type.."affs"]) do
- if echidna.affdict[v].priority() < echidna.affdict[affliction].priority() then
- table.insert(echidna[type.."affs"],k,affliction)
- return true
- end
- end
- table.insert(echidna[type.."affs"],affliction)
- return true
- end
- if not table.contains(echidna.afflictions,aff) then
- for curetype,_ in pairs(echidna.affdict[aff].cures) do
- addToAffList(aff,tostring(curetype))
- end
- table.insert(echidna.afflictions,aff)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement