Skip to content

Commit

Permalink
add effective_type in formulas
Browse files Browse the repository at this point in the history
  • Loading branch information
newfrenchy83 committed Dec 15, 2024
1 parent be7645b commit 47e0c65
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/formula/callable_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 47e0c65

Please sign in to comment.