示例#1
0
    def set(self, prop, value):
        Entity.set(self, prop, value)
        model = State.model()

        max_hp = self.get(properties.max_hp)

        if value <= 3 and prop.type == properties.Property.TYPE_ATTR:
            model.log_message("LOW ATTRIBUTE WARNING: " + prop.name)
            model.do_update("log")
        elif prop == properties.hp and self.get(properties.hp) <= max_hp * 0.4:
            model.log_message("LOW HP WARNING: " + str(self.get(properties.hp)))
            model.do_update("log")