Beispiel #1
0
        public override sealed void _Execute( object subject )
        {
            if( subject is GridTile ) {

                Debug.Log( owner + " throwing " + source + " to " + subject );

                GridTile destinationTile = subject as GridTile;

                Vector3 destination = destinationTile.transform.position;

                Process p;

                p = new ProcessBook.Wait( 10 );
                processManager.Add( p );

                if( destinationTile.occupied && owner.team.IsAlly( destinationTile.currentUnit ) ) {

                    destination += Vector3.up * destinationTile.currentUnit.propHeight;
                    p = p.Enqueue( new ProcessBook.Throw( owner, source as Grenade, destination ) );
                    p = p.Enqueue( new ProcessBook.Wait( 10 ) );
                    //p = p.Enqueue( new ProcessBook.InstantProcess( () => PassEquipment( destinationTile.currentUnit ) ) );

                } else {

                    if( destinationTile.obstructed ) {
                        destination += Vector3.up * destinationTile.obstruction.height * 2;
                    }
                    p = p.Enqueue( new ProcessBook.Throw( owner, source as Grenade, destination, .5f ) );
                    p = p.Enqueue( new ProcessBook.Wait( 10 ) );
                    p = p.Enqueue( OnFallen( destinationTile ) );

                }

                p.eventEnded += Finish;

            } else
                Debug.LogWarning( name.ToUpper() + " ACTION SUBJECT IS INCORRECT TYPE" );
        }
Beispiel #2
0
        public override void _Execute( object subject )
        {
            Process p = new ProcessBook.Wait( 10 );
            processManager.Add( p );

            //p = p.Enqueue( new ProcessBook.AreaDamage( owner.spots.torso.position, 4, 4 ) );

            Watcher w = new WatchingUnit<ProcessBook.UnitMoveAlongPath>( owner );
            processManager += w;
            w.instances = 2;
            w.eventWillStart +=
                delegate( Process process ) {

                    Debug.LogWarning( ( (ProcessBook.UnitMoveAlongPath)process ).subjectUnit + " IS MOVING MOVING MOVING!!!!" );

                    Process p2 = new ProcessBook.Trace( "I'LL SHOOT HIM!!!!" );
                    Process p3 = new ProcessBook.UnitAttack( owner, ( (ProcessBook.UnitMoveAlongPath)process ).subjectUnit );
                    p2.Enqueue( p3 );
                    process.Enqueue( p2 );
                    //GodOfProcesses.JumpAdd( p3 );

                };

            owner.buffs += BuffBook.Bleeding( owner );

            p = p.Enqueue( new ProcessBook.Wait( 10 ) );

            p.eventEnded += Finish;
        }