Package vee.enemies

Source Code of vee.enemies.Henchwoman

package vee.enemies;

import java.util.EnumMap;
import vee.AttackAction;
import vee.EquippedItems;
import vee.types.DamageType;
import vee.Inventory;
import static vee.enemies.Enemy.BAG_SIZE;
import vee.items.armors.*;
import vee.items.weapons.*;
import vee.types.GenderType;
import vee.utilities.Utility;

public class Henchwoman extends Enemy {
  protected static final String[] titles = {
    "Mistress",
    "Miss",
    "Madam",
    "Prefect",
    "Provost",
    "Vizier",
    "Chatelaine",
    "Seneschal"
  };
 
  protected static final String[] firstNames = {
    "Penelope",
    "Caitlyn",
    "Eve",
    "Maxie",
    "Lila",
    "Alicia",
    "Victoria",
    "Ameline",
    "Elliana",
    "Persephone"
  };
 
  protected static final String[] lastNames = {
    "Kinealy",
    "Sommer",
    "Creery",
    "Reed",
    "Chersley",
    "Achenson",
    "Silver",
    "Deumars"
  };
 
 
  public Henchwoman() {
    super();
  }
 
  @Override
  protected void setDefaults() {
   
    // Personals
    this.setMaxHealth(50.0);
    this.setCurrentHealth(this.getMaxHealth());
    this.generateName();
   
    this.vulnerabilities = new EnumMap<>(DamageType.class);
    for(DamageType damageType : DamageType.values()) {
      this.vulnerabilities.put(damageType, 1.0);
    }
    this.vulnerabilities.put(DamageType.Heat,     1.2);
    this.vulnerabilities.put(DamageType.Magnetic, 0.0);
    this.setDefense(0.0);
   
   
    this.setGender(GenderType.Female);
   
    this.setMapCharacter('h');
   
    // Inventory and Equipment creation
    this.inventory = new Inventory(BAG_SIZE);
    this.equipment = new EquippedItems();
   
    // Put some clothes on
    this.gearUp();
   
  }
 
  private void gearUp() {
    this.equip(new Sword());
    this.equip(new Corset());
    this.equip(new Stilleto());
    this.equip(new HairpinKnife());
  }
 
  private void generateName() {
    Integer titleLength     = this.titles.length;
    Integer firstNameLength = this.firstNames.length;
    Integer lastNameLength  = this.lastNames.length;

   
    Integer titleIndex     = Utility.generateRandom(titleLength);
    Integer firstNameIndex = Utility.generateRandom(firstNameLength);
    Integer lastNameIndex  = Utility.generateRandom(lastNameLength);
   
   
    this.setTitledName(this.titles[titleIndex],
                       this.firstNames[firstNameIndex],
                       this.lastNames[lastNameIndex]
    );
   
  }
 
  private Weapon getWeapon() {
    return (Weapon)this.equipment.getMainHand();
  }

  @Override
  public AttackAction attack() {
    return this.getWeapon().attack();
  }
 

}
TOP

Related Classes of vee.enemies.Henchwoman

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.