Advertisement
Guest User

Untitled

a guest
Feb 11th, 2012
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package  otherlib.eventsystem{
  2.    
  3.     import otherlib.roomcontroller.roomJobChange;
  4.     import otherlib.data.GameData;
  5.     import otherlib.roomcontroller.job;
  6.    
  7.     public class jobStart {
  8.  
  9.         public static var jobArray:Array = [];
  10.         //okay first off we need to fill the array before doing anything
  11.        
  12.         public static function makeJobArray() {
  13.             cleanJob();//get rid of it
  14.             var time:int = new int();
  15.             time = GameData.charTime;
  16.             //first we need to find out where the girls are and what room they are in
  17.             var room:int = new int(0);
  18.             for(var i:int = 0; i <  GameData.GameArray.length; i++) {
  19.                 var jc:jobClass = new jobClass();
  20.                 jc.jobGirl = i;     // okay we know that the girl exists!
  21.                 if(time == 1) {
  22.                     room = GameData.GameArray[i].girlMorning;
  23.                 }
  24.                 if(time == 2) {
  25.                     room =  GameData.GameArray[i].girlAfternoon;
  26.                 }
  27.                 if(time == 3) {
  28.                     room =  GameData.GameArray[i].girlEvening;
  29.                 }
  30.                 else {
  31.                     room =  GameData.GameArray[i].girlNight;
  32.                 }
  33.                 var jobType:String = new String();
  34.                 trace("room: " + room + " time: " + time);
  35.                 jc.jobType = roomJobChange.getJobValue(room + 1, time);
  36.                
  37.                 //now we need to find the actual item for the job
  38.                 jc.jobEvent = findJobToEvent(jc.jobType);
  39.                
  40.                 //wait what if she is in the pens?!?!  bah just throw it away...
  41.                 if(room != -1) {
  42.                     //okay we know the girl, the room and time and job
  43.                     jobArray.push(jc);
  44.                 }
  45.                
  46.             }
  47.             /*trace(jobArray);
  48.             trace("Type: " + jobArray[0].jobType);
  49.             trace("Event: " + jobArray[0].jobEvent);
  50.             trace("Girl: " + jobArray[0].jobGirl);*/
  51.             startJob();
  52.         }
  53.        
  54.            
  55.        
  56.         public static function startJob() {
  57.             if(jobArray.length != 0) {
  58.                 eveSys.eveRun(jobArray[0].jobEvent);
  59.             }
  60.            
  61.         }
  62.        
  63.         public static function findJobToEvent(lab:String):String {
  64.             for(var i:int = 0; i < job.jobInfo.length; i++) {
  65.                 if(job.jobInfo[i].jName == lab) {
  66.                     return job.jobInfo[i].jEvent;
  67.                 }
  68.             }
  69.             return "restjob";
  70.         }
  71.        
  72.         public static function cleanJob() {
  73.             while(jobArray.length != 0) {
  74.                 jobArray.splice(0,1);
  75.             }
  76.         }
  77.     }
  78.    
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement