mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-04-19 21:33:15 +02:00
Stat and StatModifier is also a resource now. Stats are not yet exposed as properties, as they need a bit of rework to work properly this way.
This commit is contained in:
parent
6d65814169
commit
9f5248b297
@ -7159,6 +7159,11 @@ void Entity::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_stat_enum", "index"), &Entity::get_stat_enum);
|
||||
ClassDB::bind_method(D_METHOD("set_stat_enum", "stat_id", "entry"), &Entity::set_stat_enum);
|
||||
|
||||
//todo
|
||||
//for (int i = 0; i < Stat::STAT_ID_TOTAL_STATS; ++i) {
|
||||
// ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "stats/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "Stat"), "set_stat_int", "get_stat_int", i);
|
||||
//}
|
||||
|
||||
//Equipment System
|
||||
|
||||
ADD_SIGNAL(MethodInfo("son_equip_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot")));
|
||||
|
@ -595,7 +595,7 @@ void Stat::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_owner"), &Stat::get_owner);
|
||||
ClassDB::bind_method(D_METHOD("set_owner", "value"), &Stat::set_owner_bind);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_owner", "get_owner");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Entity", 0), "set_owner", "get_owner");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_stat_modifier_type"), &Stat::get_stat_modifier_type);
|
||||
ClassDB::bind_method(D_METHOD("set_stat_modifier_type", "value"), &Stat::set_stat_modifier_type);
|
||||
|
@ -23,7 +23,7 @@ SOFTWARE.
|
||||
#ifndef STAT_H
|
||||
#define STAT_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "core/resource.h"
|
||||
#include "core/ustring.h"
|
||||
#include "core/vector.h"
|
||||
#include "scene/resources/curve.h"
|
||||
@ -33,8 +33,8 @@ SOFTWARE.
|
||||
class StatDataEntry;
|
||||
class Entity;
|
||||
|
||||
class Stat : public Reference {
|
||||
GDCLASS(Stat, Reference);
|
||||
class Stat : public Resource {
|
||||
GDCLASS(Stat, Resource);
|
||||
|
||||
public:
|
||||
static const String STAT_BINDING_STRING;
|
||||
|
@ -23,12 +23,12 @@ SOFTWARE.
|
||||
#ifndef STAT_MODIFIER_H
|
||||
#define STAT_MODIFIER_H
|
||||
|
||||
#include "core/reference.h"
|
||||
#include "core/resource.h"
|
||||
|
||||
class Stat;
|
||||
|
||||
class StatModifier : public Reference {
|
||||
GDCLASS(StatModifier, Reference);
|
||||
class StatModifier : public Resource {
|
||||
GDCLASS(StatModifier, Resource);
|
||||
|
||||
public:
|
||||
StatModifier();
|
||||
|
Loading…
Reference in New Issue
Block a user