Пример #1
0
    def do_wind(self, line):
        """wind [index]
        Use Second Wind for combatant"""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return
        c.use_second_wind()
Пример #2
0
    def do_unwait(self, line):
        """unwait
        Removes the specified combatant from the wait list and adds them back into the initiative roster."""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        self.btl.unwait(c.index)
Пример #3
0
    def do_surge(self, line):
        """surge [index] [heal]
        Combatant with index uses a healing surge. If heal is 0, don't heal the combatant"""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        heal = True
        if len(data) >= 2 and data[1] == '0':
            heal = False
        c.use_surge(heal)
Пример #4
0
    def do_temp(self, line):
        """temp [index] [amount]
        Add temporary hit points to the specified combatant"""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return
        
        if len(data) >= 2:
            amount = int(data[1])
        else:
            amount = easyinput.input_int('amount')

        c.add_temp_hp(amount)
Пример #5
0
    def do_heal(self, line):
        """heal [index] [amount]
        Heal hit points for the specified combatant"""
        
        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        if len(data) >= 2:
            amount = int(data[1])
        else:
            amount = easyinput.input_int('amount')
            
        c.heal(amount)
Пример #6
0
    def do_damage(self, line):
        """damage [index] [amount]
        Deals damage to the specified combatant"""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        if len(data) >= 2:
            amount = int(data[1])
        else:
            amount = easyinput.input_int('damage')
            
        c.damage(amount)
Пример #7
0
    def do_recharge(self, line):
        """recharge [index] [recharge_index]
        Use a rechargable power"""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        if len(data) >= 2:
            index = int(data[1])
        else:
            r = c.choose_recharge_power()
            index = None
            if r:
                index = r['index']

        if index != None:
            c.use_recharge_power(index)
Пример #8
0
    def do_rmcond(self, line):
        """rmcond [index] [condition_index]
        Remove a condition from a combatant early."""

        data = parse_data(line)

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        if len(data) >= 2:
            index = int(data[1])
        else:
            cond = c.choose_condition()
            index = None
            if cond:
                index = cond['index']

        if index != None:
            c.remove_condition(index)
Пример #9
0
    def do_cond(self, line):
        """cond [index] [name] [type] [duration] [start|end]
        Add a temporary condition to a combatant, optionally specifying the condition name, type (s or t), duration and what phase of the combatant's turn it expires on"""

        data = parse_data(line)

        duration = None
        end_type = 'e'

        c = battle.do_combatant_select(self.btl, data)
        if not c:
            return

        name = easyinput.do_data_input_str(data, 1, 'condition name')
        ctype = easyinput.do_data_input_str(data, 2, 'condition type', default='s', show_default=True)

        if ctype == 't':
            duration = easyinput.do_data_input_int(data, 3, 'duration')
            end_type = easyinput.do_data_input_str(data, 4, '(s)tart|(e)nd', default='e', show_default=True)

        c.add_condition(name, ctype, duration, end_type)