Commits

Anonymous committed ce5fa8d

moved fighting styles from textrpg.Char into rpg_1d6.char, where it belongs.

Comments (0)

Files changed (2)

-c9fa7609c032b873ecb2127124a999c92dd8315d rpg_lib/textrpg_1d6
+7786aa6fb6f8c1cc9901f60f7c648d6aa75a3ca8 rpg_lib/textrpg_1d6

rpg_lib/anyrpg.py

         scrib += linesep + _("---/battle-stats---")
         return scrib
     
-    def fight_round(self,  other, styles_self=[], styles_other=[]):
-        """One battle action against another char.
-        
-    @param styles_self: The different styles the char should use (defense, pull back, escape, target: area). 
-    @type styles_self: A list of Strings. 
-    
-    @param styles_other: The different styles the enemy uses. 
-    @type styles_other: A list of Strings. 
-    
-    @return: [ If the char won (bool), [your new wounds, critical, taken tp damage], [the 
-enemies new wounds, critical, taken tp damage] ]
-
-    Plans: 
-        - TODO: Add options for own fight style. 
-        - TODO: Add options for other fight style. 
-        
-    Planned options for own fight style: 
-        - defense (+6, no damage enemy)
-        - pull back (+9, no damage enemy)
-        - try to escape. 
-        - target specific body area for additional damage. 
-        - Shield/evasion (treshold for the enemies diff, below which no hit was archieved).
-    
-    Ideas: 
-        - Define a damage multiplier, which shows how effective the damage type is against the specific enemy -> do that in the char itself. 
-        - Define the effectivity of the armor against the weapon. 
-        - Get the treshold directly from the char. 
-."""
-       # Initialize all variables empty
-        won = None #: Did we win this round?
-        mods_self = [] #: The modifiers for the protagonists attack roll. 
-        mods_other = [] #: The modifiers for the enemies attack roll. 
-        deep_wounds_self, deep_wounds_other, critical_wounds_self, critical_wounds_other = 0, 0, 0, 0
-        
-        
-        # Apply the effects of the fighting styles. 
-            # For the attacker
-        # The defensive style gives 6 points bonus, but the other char won't take any damage. 
-        if "defensive" in styles_self: 
-            mods_self.append(+6)
-        # Targetting the head gives 6 points malus, but increases the damage by 18 points. 
-        if "target head" in styles_self: 
-            mods_self.append(-6)
-            
-            # For the defender
-        # The defensive style gives 6 points bonus, but the other char won't take any damage. 
-        if "defensive" in styles_other: 
-            mods_other.append(+6)
-        # Targetting the head gives 6 points malus, but increases the damage by 18 points. 
-        if "target head" in styles_other: 
-            mods_other.append(-6)
-        
-        
-        #: The damage we get
-        self.damage_self = 0
-        #: The damage the other gets
-        self.damage_other = 0
-        
-        # Do the rolls for both fighters. 
-        attack_self = self.attack_roll(mods=mods_self)
-        attack_other = other.attack_roll(mods=mods_other)
-        
-        # If I throw higher
-        if attack_self > attack_other: 
-            won = True
-            if not "defensive" in styles_self: 
-                # Now check for damage (we hit)
-                # The damage consists of several factors. 
-                # First the difference between the attack rolls. 
-                self.damage_other += attack_self - attack_other
-                # Then the damage of our weapon. 
-                self.damage_other += self.dam
-                # And substracted the armor of the other. 
-                self.damage_other -= other.arm
-                
-                # For specific body ares, the damage increases. 
-                if "target head" in styles_self: 
-                    self.damage_other += 18
-        
-                # Clean out negative damage. If the damage is below zero, the armor caught all damage. 
-                if self.damage_other < 0: 
-                    self.damage_other = 0
-                
-                # Now actually do the damage. This returns a tuple: (new deep wounds, new critical wounds)
-                deep_wounds_other, critical_wounds_other = other.damage(tp=self.damage_other)
-        
-        # If the other rolls better
-        elif attack_self < attack_other: 
-            won = False
-            # Check for our damage (the other hit)
-            if not "defensive" in styles_other: 
-                # The damage consists of several factors. 
-                # First the difference between the attack rolls. 
-                self.damage_self += attack_other - attack_self
-                # Then the damage of our weapon. 
-                self.damage_self += other.dam
-                # And substracted the armor of the other. 
-                self.damage_self -= self.arm
-                
-                # For specific body ares, the damage increases. 
-                if "target head" in styles_other: 
-                    self.damage_self += 18
-    
-                # Clean out negative damage. If the damage is below zero, the armor caught all damage. 
-                if self.damage_self < 0: 
-                    self.damage_self = 0
-                
-                # Now actually take the damage. This returns a tuple: (new deep wounds, new critical wounds)
-                deep_wounds_self, critical_wounds_self = self.damage(tp=self.damage_self)
-
-        # If we get the same result, the attacker wins, us. 
-        else:   
-            won = True
-            if not "defensive" in styles_self: 
-                # Now check for damage (we hit)
-                # The damage consists of several factors. 
-                # First the difference between the attack rolls. 
-                self.damage_other += attack_self - attack_other
-                # Then the damage of our weapon. 
-                self.damage_other += self.dam
-                # And substracted the armor of the other. 
-                self.damage_other -= other.arm
-                
-                # For specific body ares, the damage increases. 
-                if "target head" in styles_self: 
-                    self.damage_other += 18
-            
-                # Clean out negative damage. If the damage is below zero, the armor caught all damage. 
-                if self.damage_other < 0: 
-                    self.damage_other = 0
-                
-                # Now actually do the damage. This returns a tuple: (new deep wounds, new critical wounds)
-                deep_wounds_other, critical_wounds_other = other.damage(tp=self.damage_other)
-            
-        return won, [deep_wounds_self, critical_wounds_self, self.damage_self], [deep_wounds_other, critical_wounds_other, self.damage_other]
-    
 
 class Story(UserInteraction, Dialogs): 
     """The main component for telling stories. Subclass this to change all behaviour."""