package mug12; import java.util.Vector; import java.util.Random; import java.util.Hashtable; public class Maniac extends Person { //In order for Maniac to function it will need to be passed an array from the world group telling the maniac //what people are in a room. public Maniac(String _name, String _description, String _sex, String _major, Hashtable _verbs, Hashtable _attributes, Vector _inventory) { super(_name,_description,_sex,_major,_verbs,_attributes,_inventory); } public String attackrandomly(Object[] people) { Random num = new Random(); String assault = "attack"; int index = num.nextInt(people.length) - 1; // assuming there is an index of people this will pick one of them at random Object target = people[index]; if (people == null) { return "maniac sits quietly in the corner"; } else { // return something that will attack return "null"; } //"attack" will be another verb decided on by the world group once we find out what kind of //combat can be initiated }//attackrandomly }//class Maniac