Beispiel #1
0
    def build(self):
        """
        Builds a spell

        :returns: a spell
        :rtype: Spell
        """
        spell = Spell()
        spell.spirit = self.spirit

        for handle in self.handles:
            spell.add_effect_handle(handle)

        for target in self.targets:
            spell.targets.append(
                TargetData('character', target.location, target, None))

        return spell
Beispiel #2
0
    def build(self):
        """
        Builds a spell

        :returns: a spell
        :rtype: Spell
        """
        spell = Spell()
        spell.spirit = self.spirit

        for handle in self.handles:
            spell.add_effect_handle(handle)

        for target in self.targets:
            spell.targets.append(TargetData('character',
                                            target.location,
                                            target,
                                            None))

        return spell
Beispiel #3
0
    def create_spell(self, spell_name, targets):
        """
        Create a spell

        :param spell_name: name of the spell
        :type spell_name: string
        :param target: target of the spell
        :type target: Character
        :returns: ready to use spell
        :rtype: Spell
        """
        new_spell = Spell()
        new_spell.targets.extend(targets)

        spec = self.spell_list[spell_name]
        new_spell.spirit = spec.spirit
        handles = spec.effect_handles

        for effect_handle in handles:
            new_spell.add_effect_handle(effect_handle)

        return new_spell
Beispiel #4
0
    def create_spell(self, spell_name, targets):
        """
        Create a spell

        :param spell_name: name of the spell
        :type spell_name: string
        :param target: target of the spell
        :type target: Character
        :returns: ready to use spell
        :rtype: Spell
        """
        new_spell = Spell()
        new_spell.targets.extend(targets)

        spec = self.spell_list[spell_name]
        new_spell.spirit = spec.spirit
        handles = spec.effect_handles

        for effect_handle in handles:
            new_spell.add_effect_handle(effect_handle)

        return new_spell