From 47e0c65aa79742d2520d3b472b19e53f8643c03d Mon Sep 17 00:00:00 2001 From: newfrenchy83 Date: Wed, 3 Jul 2024 16:57:51 +0200 Subject: [PATCH] add effective_type in formulas --- src/formula/callable_objects.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/formula/callable_objects.cpp b/src/formula/callable_objects.cpp index 124386737314f..59accb5524230 100644 --- a/src/formula/callable_objects.cpp +++ b/src/formula/callable_objects.cpp @@ -87,8 +87,10 @@ variant attack_type_callable::get_value(const std::string& key) const return variant(att_->id()); } else if(key == "description") { return variant(att_->name()); - } else if(key == "type") { + } else if(key == "original_type") { return variant(att_->type()); + } else if(key == "type") { + return variant(att_->effective_damage_type().first); } else if(key == "icon") { return variant(att_->icon()); } else if(key == "range") { @@ -133,6 +135,7 @@ void attack_type_callable::get_inputs(formula_input_vector& inputs) const { add_input(inputs, "name"); add_input(inputs, "type"); + add_input(inputs, "base_type"); add_input(inputs, "description"); add_input(inputs, "icon"); add_input(inputs, "range"); @@ -173,6 +176,10 @@ int attack_type_callable::do_compare(const formula_callable* callable) const return att_->type().compare(att_callable->att_->type()); } + if(att_->effective_damage_type().first != att_callable->att_->effective_damage_type().first) { + return att_->effective_damage_type().first.compare(att_callable->att_->effective_damage_type().first); + } + if(att_->range() != att_callable->att_->range()) { return att_->range().compare(att_callable->att_->range()); }