<commit_before>package zombiefu.creature;

import jade.core.Actor;
import jade.util.Dice;
import jade.util.Guard;
import jade.util.datatype.ColoredChar;
import jade.util.datatype.Coordinate;
import jade.util.datatype.Direction;
import java.util.Collection;
import java.util.Iterator;
import zombiefu.items.Waffe;

public abstract class Creature extends Actor {

    private int healthPoints;
    private int attackValue;
    private int defenseValue;
    private int dazed;
    private Waffe activeWeapon;
    private String name;
    protected boolean godMode;
    

    public Creature(ColoredChar face, String n, int h, int a, int d, Waffe w) {
        super(face);
        dazed = 0;
        name = n;
        healthPoints = h;
        attackValue = a;
        defenseValue = d;
        activeWeapon = w;
    }

    public Creature(ColoredChar face,String name) {
        this(face, name, 1, 1, 1, new Waffe("Faust", 1,ColoredChar.create('|')));
    }

    @Override
    public void setPos(int x, int y) {
        if (world().passableAt(x, y)) {
            super.setPos(x, y);
        }
    }

    public void attack(Creature cr) {
        Guard.validateArgument(!this.equals(cr));

        // Wer keine Waffe hat, kann nicht angreifen!
        if (activeWeapon == null) {
            return;
        }

        // Monster greifen keine Monster an!
        if (this instanceof Monster && cr instanceof Monster) {
            return;
        }

        System.out.println(getName() + " attacks " + cr.getName() + " with " + activeWeapon.getName() + " (Damage: " + activeWeapon.getDamage() + "). Attack value: " + attackValue + ", Defense Value: " + cr.defenseValue);

        // Calculate damage
        int damage = activeWeapon.getDamage() * (attackValue / cr.defenseValue) * Dice.global.nextInt(20, 40) / 30;
        System.out.println("Berechneter Schaden: " + damage);

	if(damage == 0)
		damage = 1;
        cr.hurt(damage);<commit_msg>Fehler beim Merge korrigiert.<commit_after>package zombiefu.creature;

import jade.core.Actor;
import jade.util.Dice;
import jade.util.Guard;
import jade.util.datatype.ColoredChar;
import jade.util.datatype.Coordinate;
import jade.util.datatype.Direction;
import java.util.Collection;
import java.util.Iterator;
import zombiefu.items.Waffe;

public abstract class Creature extends Actor {

    private int healthPoints;
    private int attackValue;
    private int defenseValue;
    private int dazed;
    private Waffe activeWeapon;
    private String name;
    protected boolean godMode;
    

    public Creature(ColoredChar face, String n, int h, int a, int d, Waffe w) {
        super(face);
        dazed = 0;
        name = n;
        healthPoints = h;
        attackValue = a;
        defenseValue = d;
        activeWeapon = w;
    }

    public Creature(ColoredChar face,String name) {
        this(face, name, 1, 1, 1, new Waffe("Faust", 1,ColoredChar.create('|')));
    }
    
    public Creature(ColoredChar face) {
        this(face,"Zombie");
    }

    @Override
    public void setPos(int x, int y) {
        if (world().passableAt(x, y)) {
            super.setPos(x, y);
        }
    }

    public void attack(Creature cr) {
        Guard.validateArgument(!this.equals(cr));

        // Wer keine Waffe hat, kann nicht angreifen!
        if (activeWeapon == null) {
            return;
        }

        // Monster greifen keine Monster an!
        if (this instanceof Monster && cr instanceof Monster) {
            return;
        }

        System.out.println(getName() + " attacks " + cr.getName() + " with " + activeWeapon.getName() + " (Damage: " + activeWeapon.getDamage() + "). Attack value: " + attackValue + ", Defense Value: " + cr.defenseValue);

        // Calculate damage
        int damage = activeWeapon.getDamage() * (attackValue / cr.defenseValue) * Dice.global.nextInt(20, 40) / 30;
        System.out.println("Berechneter Schaden: " + damage);

	if(damage == 0)
		damage = 1;
        cr.hurt(damage);
{'fraction_non_alphanumeric': 0.11659979939819458, 'fraction_numerical': 0.006519558676028084, 'mean_word_length': 2.517636684303351, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3850932', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1227, 'n_words': 320}