Exemplo n.º 1
0
    def insertAssistSkillEffects(self, assistskillid, skilleffectList):
        # assistskilleffects SET UP        
        for effects in skilleffectList:
            # Type for skills
            #typeid=self.getBaseConstants(Type(None, temp_type), False)
            temp_target = effects.get("target")
            temp_attribute = effects.get("attribute")
            temp_modifier = effects.get("modifier")
            temp_element = effects.get("element")
            temp_type = effects.get("type")
            if(temp_modifier==None):
                temp_modifier=""
            if(len(temp_modifier) > 0 and temp_modifier[len(temp_modifier)-1] == "%"):
                temp_modifier = temp_modifier[:len(temp_modifier)-1]
            targetid = self.getBaseConstants(Target(None, temp_target), False)
            attributeid = self.getBaseConstants(Attribute(None, temp_attribute), False)
            modifierid = self.getBaseConstants(Modifier(None, temp_modifier), True)
            if(temp_element == None):
                temp_element = ""
            if(temp_type == None):
                temp_type = ""

            eleid = self.getBaseConstants(Element(None, temp_element), False)
            typeid = self.getBaseConstants(Type(None, temp_type), False)

            # inserting effects
            self._db.insertData(AssistSkillEffects(None, assistskillid, targetid,
                 attributeid, modifierid, effects.get("duration"), effects.get("max_activations"),eleid,typeid))
Exemplo n.º 2
0
 def insertAdventurerSkillEffects(self, adventurerskillid, skilleffectList):
     ele_list = [
         'light', 'wind', 'fire', 'dark', 'ice', 'water', 'earth', 'thunder'
     ]
     # AdventurerSkillEffects SET UP
     for effects in skilleffectList:
         #Type+Element
         temp_type = effects.get("type")
         if (temp_type == None):
             temp_type = ""
         temp_element = effects.get("element")
         if (temp_element == None):
             temp_element = ""
         if (temp_type.split("_")[0] in ele_list):
             temp_split = temp_type.split("_")
             temp_element = temp_split[0]
             print(temp_type)
             temp_type = temp_split[1] + "_" + temp_split[2]
             #temp_index = temp_value.find("_")
             #temp_element = temp_value[0:temp_index]
             #temp_ad_ele = temp_element
             #temp_type = temp_value[temp_index+1:]
         #else:
         #temp_type = ""
         #temp_element=""
         # Element
         eleid = self.getBaseConstants(Element(None, temp_element), False)
         # Type for skills
         typeid = self.getBaseConstants(Type(None, temp_type), False)
         temp_target = effects.get("target")
         temp_attribute = effects.get("attribute")
         temp_speed = effects.get("speed")
         temp_modifier = effects.get("modifier")
         if (temp_modifier == None):
             temp_modifier = ""
         if (len(temp_modifier) > 0
                 and temp_modifier[len(temp_modifier) - 1] == "%"):
             temp_modifier = temp_modifier[:len(temp_modifier) - 1]
         targetid = self.getBaseConstants(Target(None, temp_target), False)
         attributeid = self.getBaseConstants(
             Attribute(None, temp_attribute), False)
         speedid = self.getBaseConstants(Speed(None, temp_speed), False)
         modifierid = self.getBaseConstants(Modifier(None, temp_modifier),
                                            True)
         # inserting effects
         self._db.insertData(
             AdventurerSkillEffects(None, adventurerskillid, targetid,
                                    attributeid, modifierid,
                                    effects.get("duration"), typeid, eleid,
                                    speedid))
Exemplo n.º 3
0
 def insertAdventurerSkillEffects(self, adventurerskillid, skilleffectList):
     # AdventurerSkillEffects SET UP
     for effects in skilleffectList:
         #Type+Element
         temp_type = effects.get("type")
         if (temp_type == None):
             temp_type = ""
         temp_element = effects.get("element")
         if (temp_element == None):
             temp_element = ""
             #temp_index = temp_value.find("_")
             #temp_element = temp_value[0:temp_index]
             #temp_ad_ele = temp_element
             #temp_type = temp_value[temp_index+1:]
         #else:
         #temp_type = ""
         #temp_element=""
         # Element
         eleid = self.getBaseConstants(Element(None, temp_element), False)
         # Type for skills
         typeid = self.getBaseConstants(Type(None, temp_type), False)
         temp_target = effects.get("target")
         temp_attribute = effects.get("attribute")
         temp_speed = effects.get("speed")
         temp_modifier = effects.get("modifier")
         if (temp_modifier == None):
             temp_modifier = ""
         if (len(temp_modifier) > 0
                 and temp_modifier[len(temp_modifier) - 1] == "%"):
             temp_modifier = temp_modifier[:len(temp_modifier) - 1]
         targetid = self.getBaseConstants(Target(None, temp_target), False)
         attributeid = self.getBaseConstants(
             Attribute(None, temp_attribute), False)
         speedid = self.getBaseConstants(Speed(None, temp_speed), False)
         modifierid = self.getBaseConstants(Modifier(None, temp_modifier),
                                            True)
         # inserting effects
         db.insertData(
             AdventurerSkillEffects(None, adventurerskillid, targetid,
                                    attributeid, modifierid,
                                    effects.get("duration"), typeid, eleid,
                                    speedid))