/// <summary> /// Generate a reaction to a move /// </summary> /// <param name="moves">Moves</param> /// <param name="who">who made the move(s)</param> public void ReactMove(List<Move> moves, Player who) { FMLBody body = new FMLBody(); PerformativeChunk pc = new PerformativeChunk(); pc.AddFunction(new ReactMoveFunction(moves, who == player)); pc.owner = me; body.AddChunk(pc); interpret(body); }
/// <summary> /// Generates the appropriate FML for considering the given move. /// Every 2 seconds, generates the emotion only. /// Every 4 seconds, generates both emotion and move consideration. /// Interprets it instantly. /// </summary> /// <param name="move">Move to consider.</param> public void ConsiderMove(Move move) { if (lastTime == -1) lastTime = Time.time; FMLBody body = new FMLBody(); if (Time.time >= lastTime + 4f) { MentalChunk mc = new MentalChunk(); //eye movement every 4 mc.AddFunction(new ConsiderMoveFunction(move)); mc.owner = me; body.AddChunk(mc); body.AddChunk(getEmotion()); interpret(body); lastTime = Time.time; } else if (Time.time >= lastTime + 2f) { //emotions every second body.AddChunk(getEmotion()); interpret(body); } }
/// <summary> /// Generates the FML for executing a move and interprets it. /// </summary> /// <param name="moves"></param> public void ExecuteMove(List<Move> moves) { FMLBody body = new FMLBody(); PerformativeChunk pc = new PerformativeChunk(); pc.AddFunction(new MakeMoveFunction(moves)); pc.owner = me; body.AddChunk(pc); body.AddChunk(getEmotion()); interpret(body); }