Esempio n. 1
0
        private int _width, _height; //PIXELS!!!

        #endregion Fields

        #region Constructors

        public CLayer(string name, Actors.CComponent[] components, CTile[] tiles)
        {
            NAME = name;
            _tiles = tiles;
            _components = new ComponentManager(new ComponentFactory[]{ new ComponentFactory(components) } );
            _image = Graphics.CTextures.generateLayerImage(this, tiles);
        }
 internal static ISpell generatedBy(Actors.Hand right, Actors.Hand left)
 {
     if (right.lastGestures(3) == combo1 || right.lastGestures(3) == combo2 )
     {
         return new CounterSpell(right);
     }
     if (left.lastGestures(3) == combo1 || left.lastGestures(3) == combo2)
     {
         return new CounterSpell(left);
     }
     return null;
 }
Esempio n. 3
0
        internal static ISpell generatedBy(Actors.Hand right, Actors.Hand left)
        {
            if (right.lastGestures(1) == combo)
            {
                return new Shield(right);
            }

            if (left.lastGestures(1) == combo)
            {
                return new Shield(left);
            }

            return null;
        }
        internal static ISpell generatedBy(Actors.Hand right, Actors.Hand left)
        {
            if (right.lastGestures(3) == combo)
            {
                return new Confusion(right);
            }

            if (left.lastGestures(3) == combo)
            {
                return new Confusion(left);
            }

            return null;
        }
Esempio n. 5
0
 // This function inserts a link between a film and an actor inside the ActorsInFilms table.
 public void InsertLinkActorAndFilm(Actors actor, Nullable <Guid> guidFilm)
 {
     using (SqlConnection connection = new SqlConnection(Connection.Instance.ConnectionString))
     {
         connection.Execute
             (@"
                 INSERT INTO ActorsInFilms(ActorId, FilmId)
                 VALUES (@ActorId, @FilmId)                      
                 ", new
         {
             ActorId = actor.ActorId,
             FilmId  = guidFilm
         });
     }
 }
Esempio n. 6
0
 // This function inserts the properties of the parameter (Actors object)
 // Into the database as a new entry in the Actors table.
 public void InsertActor(Actors actor)
 {
     using (SqlConnection connection = new SqlConnection(Connection.Instance.ConnectionString))
     {
         connection.Execute(@"
             INSERT INTO Actors(ActorId, FirstName, LastName)
             VALUES (@ActorId, @FirstName, @LastName)
         ", new
         {
             ActorId   = actor.ActorId,
             FirstName = actor.FirstName,
             LastName  = actor.LastName
         });
     }
 }
Esempio n. 7
0
 // This function deletes the links between a film and its genres inside the GenresInFilms table.
 public void DeleteLinkActorAndFilm(Nullable <Guid> FilmId, Actors actor)
 {
     using (SqlConnection connection = new SqlConnection(Connection.Instance.ConnectionString))
     {
         connection.Execute
             (@"
                 DELETE FROM ActorsInFilms
                 WHERE FilmId = @FilmId AND ActorId = @ActorId
                 ", new
         {
             FilmId  = FilmId,
             ActorId = actor.ActorId
         });
     }
 }
Esempio n. 8
0
    public Actors.ACTOR_DIRECTION HauntActor(Actors actor)
    {
        gameObject.GetComponent <AudioSource> ().clip = hauntClip;
        gameObject.GetComponent <AudioSource> ().Play();
        //play haunting animation
        hauntPrefab.SetActive(false);

        //Changed to bitwisw
        if ((hauntedTiles[0].effectsOnTile & Tile.TILE_EFFECTS.HAUNT) == Tile.TILE_EFFECTS.HAUNT)
        {
            hauntedTiles[0].effectsOnTile &= ~Tile.TILE_EFFECTS.HAUNT;
        }
        else
        {
            Debug.LogError("Actor activated haunt but the tile is not the current one");
        }

        actor.AddFear(amountOfFear);

        //TODO NEVER CHANGE MACHINE STATES OUTSIDE OTHER CLASSES
        //actor.state = Actors.ACTOR_STATE.MOVING;

        if (hauntDirection.z > 0)
        {
            //Debug.Log("Haunting up");
            return(Actors.ACTOR_DIRECTION.UP);
        }
        else if (hauntDirection.z < 0)
        {
            //Debug.Log("Haunting down");
            return(Actors.ACTOR_DIRECTION.DOWN);
        }
        if (hauntDirection.x > 0)
        {
            //Debug.Log("Haunting right");
            return(Actors.ACTOR_DIRECTION.RIGHT);
        }
        else if (hauntDirection.x < 0)
        {
            //Debug.Log("Haunting left");
            return(Actors.ACTOR_DIRECTION.LEFT);
        }
        else
        {
            Debug.LogError("HAUNTING ACTOR HAS RETURNED WITH DIRECTION NONE");
            return(Actors.ACTOR_DIRECTION.NONE);
        }
    }
Esempio n. 9
0
    void ShadowMessage(Actors victim)
    {
        switch (victim)
        {
        case Actors.Girl:
            _doorState++;
//            _doorState = Door.closed;
            _poopMonsterState++;
            _shadowState = Shadow.jeer;
            break;

        case Actors.Door:
            _doorState++;
            _poopMonsterState++;
            _shadowState = Shadow.jeer;
            break;

        case Actors.Chain:
            _doorState++;
            _poopMonsterState++;
            _shadowState = Shadow.jeer;
            break;

        case Actors.PoopMonster:
            _doorState++;
            _poopMonsterState++;
            _shadowState = Shadow.jeer;
            break;

        case Actors.LightsPoop:
            _doorState++;
            _poopMonsterState++;
            _shadowState = Shadow.jeer;
            break;

        case Actors.LightArea:
            _doorState++;
            _poopMonsterState++;
            _shadowState = Shadow.jeer;
            break;

        default:
            _doorState++;
            _poopMonsterState++;
            _shadowState = Shadow.talk;
            break;
        }
    }
Esempio n. 10
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="LevelOne" /> class.
        /// </summary>
        public LevelOne()
        {
            // Backgrounds
            FileName = @"Assets\LevelOne.png";

            // Enemies
            for (int i = 0; i < 5; i++)
            {
                var ship      = new Ship(this);
                int positionY = ship.Height + 10;
                int positionX = 150 + i * (ship.Width + 50);

                ship.Position = new Point(positionX, positionY);

                Actors.Add(ship);
            }
            InitTimer();

            //myship
            for (int i = 0; i < 4; i++)
            {
                var myship    = new MyShip(this);
                int positionY = myship.Height + 50;
                int positionX = 150 + i * (myship.Width + 50);

                myship.Direction = i < 2;

                myship.Position = new Point(positionX, positionY);

                Actors.Add(myship);
            }

            //Lightning
            var Lightning          = new Lightning(this);
            int lightningPositionX = Size.Width / 2 - Lightning.Width / 2;
            int lightningPositionY = Size.Height / 2 - Lightning.Height / 2;

            Lightning.Position = new Point(lightningPositionX, lightningPositionY);
            Actors.Add(Lightning);

            // Player
            Player = new PlayerShip(this);
            int playerPositionX = Size.Width / 2 - Player.Width / 2;
            int playerPositionY = Size.Height - Player.Height - 50;

            Player.Position = new Point(playerPositionX, playerPositionY);
            Actors.Add(Player);
        }
Esempio n. 11
0
        public JsonResult AddActor(AddMovieViewModel actor)
        {
            try {
                var newActor = new Actors()
                {
                    Name = actor.AName,
                    Bio  = actor.ABio,
                    Dob  = actor.ADob,
                    Sex  = actor.ASex,
                };

                actor.AId = actorsRepository.AddActor(newActor);
            }
            catch (Exception e) { string s = e.HelpLink; }
            return(Json(actor));
        }
Esempio n. 12
0
        private void UpdateActor(int index, IEnumerable <string> actions)
        {
            // Basically creating an entirely new actor.
            var actor = Actors.ElementAtOrDefault(index);

            if (actor == null)
            {
                return;
            }
            actor.Reset();
            actor.ApplyActions(actions);
            if (actor.Lander.Status == LanderStatus.Flying && MaxActions == null)
            {
                actor.ApplyFullRangeRandomActions(_randomNessProvider);
            }
        }
Esempio n. 13
0
        public void AddActor(Actor.GActor actor)
        {
            if (Actors.ContainsKey(actor.ActorId))
            {
                return;
            }
            mActorsDictionaryDirty = true;
            Actors[actor.ActorId]  = actor;
            actor.OnAddToWorld(this);

            for (int i = 0; i < actor.Children.Count; ++i)
            {
                AddActor(actor.Children[i]);
            }
            OnAddActor?.Invoke(actor);
        }
Esempio n. 14
0
 public void UpdateActor(Actors actor)
 {
     using (SqlConnection connection = new SqlConnection(Connection.Instance.ConnectionString))
     {
         connection.Execute(@"
             UPDATE Actors
             SET FirstName = @ActorFirstName, LastName = @ActorLastName 
             WHERE ActorId = @ActorId
         ", new
         {
             ActorFirstName = actor.FirstName,
             ActorLastName  = actor.LastName,
             ActorId        = actor.ActorId
         });
     }
 }
Esempio n. 15
0
    public override void PlayEvent()
    {
        Text       = "This is Jen's Phone. How can I help you?";
        EventActor = Actors.Phone_Jen();

        {
            var Messages = NewChoice("MESSAGES");
            Messages.AddNextEvent <Message1>();

            var choice = NewChoice("CALLS [2 RECORDED]");
            choice.AddNextEvent <Call1>();

            var Settings = NewChoice("SETTINGS");
            Settings.AddNextEvent <Settings>();
        }
    }
Esempio n. 16
0
        // GET: Actors/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Actors actors = db.Actors.Find(id);

            if (actors == null)
            {
                return(HttpNotFound());
            }
            ViewBag.StudioID  = new SelectList(db.Studio, "StudioID", "StudioName", actors.StudioID);
            ViewBag.TvShowsID = new SelectList(db.TvShows, "TvShowsID", "Genre", actors.TvShowsID);
            return(View(actors));
        }
Esempio n. 17
0
        public virtual IActor FindNextActorToImpersonate()
        {
            var actors = Actors.ToList();
            var currentlyImpersonated = FindImpersonatedActor();

            if (currentlyImpersonated != null)
            {
                actors.Remove(currentlyImpersonated);
            }

            return(actors.OrderByDescending(actor => Vector3.Dot((actor.Eyes.position - VR.Camera.transform.position).normalized, VR.Camera.SteamCam.head.forward)).FirstOrDefault());

            //return currentlyImpersonated != null
            //    ? actors[(actors.IndexOf(currentlyImpersonated) + 1) % actors.Count]
            //    : actors.FirstOrDefault();
        }
Esempio n. 18
0
        private void BtnDeleteActor_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ListViewItem item  = ((ListViewItem)lstActors.SelectedItem);
                Actors       actor = (Actors)item.Tag;

                DatabaseManager.Instance.ActorRepository.DeleteLinkActorAndFilm(SingletonClasses.SingletonFilms.OnlyInstanceOfFilms.FilmId.Value, actor);

                FillTextBoxes();
            }
            catch (Exception)
            {
                MessageBox.Show("Geen acteur geselecteerd");
            }
        }
Esempio n. 19
0
    private DialogueLine ParseDialogueLine(string inline, Actors inActor)
    {
        string Diagline;

        if (inline[0] == '|')
        {
            inActor  = (Actors)Enum.Parse(typeof(Actors), inline.Substring(1, 3));
            Diagline = inline.Remove(0, 5);
        }
        else
        {
            Diagline = inline;
        }

        return(new DialogueLine(Regex.Replace(Diagline, "#PLAYER#", IOSystem.Instance.data.PlayerName), inActor));
    }
Esempio n. 20
0
        public Task <bool> SaveChangesAsync()
        {
            return(Task.Run(() =>
            {
                if (FilmsToAdd.Count() <= 0 && ActorsToAdd.Count() <= 0 &&
                    DirectorsToAdd.Count() <= 0 && FilmsToDelete.Count() <= 0 &&
                    ActorsToDelete.Count() <= 0 && DirectorsToDelete.Count() <= 0)
                {
                    return false;
                }

                foreach (var film in FilmsToAdd)
                {
                    film.Id = Films.Count() + 1;
                    Films.Add(film);
                }
                foreach (var actor in ActorsToAdd)
                {
                    actor.Id = Actors.Count() + 1;
                    Actors.Add(actor);
                }
                foreach (var director in DirectorsToAdd)
                {
                    director.Id = Directors.Count() + 1;
                    Directors.Add(director);
                }

                foreach (var film in FilmsToDelete)
                {
                    var filmInList = Films.Where(f => f.Id == film.Id).FirstOrDefault();
                    Films.Remove(filmInList);
                }
                foreach (var actor in ActorsToDelete)
                {
                    var actorInList = Actors.Where(f => f.Id == actor.Id).FirstOrDefault();
                    Actors.Remove(actorInList);
                }
                foreach (var director in DirectorsToDelete)
                {
                    var directorInList = Directors.Where(f => f.Id == director.Id).FirstOrDefault();
                    Directors.Remove(directorInList);
                }

                Initialize();
                return true;
            }));
        }
Esempio n. 21
0
        //--------------------------------------------------------------------------------------------- /Обновление некоторых штучек-дрючек
        private void AddMovie_Activated(object sender, EventArgs e)
        {
            //--------------------------------------------------------------------------------------------- //Обновление списка категорий
            Category.Items.Clear();
            var category = My.MovieCategory.ToList();

            foreach (var item in category)
            {
                Category.Items.Add(item.Category.ToString());
            }
            //--------------------------------------------------------------------------------------------- //Заполнение строки с режиссёрами из дочернего окна
            if (ProducerAdd.id != null)
            {
                Producer.Clear();
                foreach (Producer c in ProducerAdd.id)
                {
                    Producer.Text += c.SecondName + " " + c.FirstName + " " + c.LastName + ", ";
                }
            }
            //--------------------------------------------------------------------------------------------- //Заполнение строки с актёрами из дочернего окна
            if (ActorAdd.id != null)
            {
                Actors.Clear();
                foreach (Actor c in ActorAdd.id)
                {
                    Actors.Text += c.SecondName + " " + c.FirstName + " " + c.LastName + ", ";
                }
            }
            //--------------------------------------------------------------------------------------------- //Заполнение строки с странами из дочернего окна
            if (CountryAdd.id != null)
            {
                Country.Clear();
                foreach (Country c in CountryAdd.id)
                {
                    Country.Text += c.CountryName + ", ";
                }
            }
            //--------------------------------------------------------------------------------------------- //Заполнение строки с жанрами из дочернего окна
            if (GenreAdd.id != null)
            {
                textBox1.Clear();
                foreach (Genre c in GenreAdd.id)
                {
                    textBox1.Text += c.Name + ", ";
                }
            }
        }
Esempio n. 22
0
        public void RemoveActor(Guid actorId)
        {
            Actor.GActor actor;
            if (Actors.TryGetValue(actorId, out actor) == false)
            {
                return;
            }
            mActorsDictionaryDirty = true;
            Actors.Remove(actorId);
            actor.OnRemoveWorld(this);

            for (int i = 0; i < actor.Children.Count; ++i)
            {
                RemoveActor(actor.Children[i].ActorId);
            }
            OnRemoveActor?.Invoke(actor);
        }
Esempio n. 23
0
        private void BtnAddActor_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Actors actor = new Actors();

                actor = ActorsList[cmbActors.SelectedIndex];

                DatabaseManager.Instance.ActorRepository.InsertLinkActorAndFilm(actor, SingletonClasses.SingletonFilms.OnlyInstanceOfFilms.FilmId);

                FillTextBoxes();
            }
            catch (Exception)
            {
                MessageBox.Show("Geen acteur geselecteerd");
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((string)Session["allow"] == "1")
        {
            addActorButton.Visible = true;
        }

        if (Request["oid"] != null)
        {
            DataList1.DataSource = Actors.GetAllActorsOrdered(Request["oid"]);
        }
        else
        {
            DataList1.DataSource = Actors.GetAllActors();
        }
        DataList1.DataBind();
    }
Esempio n. 25
0
        public void ChangePositionShip()
        {
            Ship[] arShipS = Actors.Where(actor => actor is Ship).Cast <Ship>().ToArray();

            if (arShipS.Length > 1)
            {
                var shipFirst = arShipS.First();
                shipFirst.IsLeftOrRide = true;
                var shipLast = arShipS.Last();
                shipLast.IsLeftOrRide = true;
            }
            if (arShipS.Length == 1)
            {
                var shipFirst = arShipS.First();
                shipFirst.IsLeftOrRide = true;
            }
        }
Esempio n. 26
0
        public void GenerateBullet()
        {
            var datetime = DateTime.Now.Millisecond;

            Ship2[] arShip2S = Actors.Where(actor => actor is Ship2).Cast <Ship2>().ToArray();
            var     n        = datetime;

            if (Convert.ToInt32(n) % 27 == 0 & Convert.ToInt32(n) > 0)
            {
                foreach (Ship2 ship2 in arShip2S)
                {
                    {
                        Actors.Add(ship2.CreateEnemyBullet(ship2));
                    }
                }
            }
        }
Esempio n. 27
0
    private void ParseDialogueFile(DialogueData inData, DialogueHandle inHandle)
    {
        ///Use Unity's Text Assets.
        inData.handle = inHandle;
        Actors    LineSpeaker = 0;
        TextAsset x           = Resources.Load(inHandle.directory) as TextAsset;

        using (StringReader reader = new StringReader(x.text))
        {
            string line = reader.ReadLine();
            while (line != null)
            {
                inData.AddDialogueLine(ParseDialogueLine(line, LineSpeaker));
                line = reader.ReadLine();
            }
        }
    }
        public VoiceActorInformationViewModel(Project project)
        {
            m_currentId = 0;
            m_project   = project;
            if (Actors.Any())
            {
                m_currentId = Actors.Max(a => a.Id) + 1;
            }

            InitialActorCount = Actors.Count;

            foreach (var actor in Actors)
            {
                var characterGroup = project.CharacterGroupList.GetGroupsAssignedToActor(actor.Id).FirstOrDefault();
                m_originalActors.Add(new Tuple <VoiceActor.VoiceActor, CharacterGroup>(actor.MakeCopy(), characterGroup));
            }
        }
Esempio n. 29
0
        protected virtual void HandleGetPropertiesOperation(
            PlayerPeer peer,
            GetPropertiesRequest getPropertiesRequest,
            SendParameters sendParameters)
        {
            var response = new GetPropertiesResponse();

            // check if game properties should be returned
            if ((getPropertiesRequest.PropertyType & (byte)PropertyType.Game) == (byte)PropertyType.Game)
            {
                response.GameProperties = Properties.GetProperties(getPropertiesRequest.GamePropertyKeys);
            }

            // check if actor properties should be returned
            if ((getPropertiesRequest.PropertyType & (byte)PropertyType.Actor) == (byte)PropertyType.Actor)
            {
                response.ActorProperties = new Hashtable();

                if (getPropertiesRequest.ActorNumbers == null)
                {
                    foreach (var actor in Actors)
                    {
                        var actorProperties = actor.Properties.GetProperties(getPropertiesRequest.ActorPropertyKeys);
                        response.ActorProperties.Add(actor.ActorNr, actorProperties);
                    }
                }
                else
                {
                    foreach (var actorNumber in getPropertiesRequest.ActorNumbers)
                    {
                        var actor = Actors.GetActorByNumber(actorNumber);
                        if (actor != null)
                        {
                            var actorProperties =
                                actor.Properties.GetProperties(getPropertiesRequest.ActorPropertyKeys);
                            response.ActorProperties.Add(actorNumber, actorProperties);
                        }
                    }
                }
            }

            peer.SendOperationResponse(
                new OperationResponse(getPropertiesRequest.OperationRequest.OperationCode, response),
                sendParameters);
        }
Esempio n. 30
0
        public ActionResult AddActor(Actors objActor)
        {
            IMDB_Context context = new IMDB_Context();

            if (ModelState.IsValid)
            {
                var num = context.Actors.Where(x => x.Name == objActor.Name && x.Sex == objActor.Sex).ToList <Actors>().Count;
                if (num > 0)
                {
                    ModelState.AddModelError("", "Actor Already Exist");
                    return(View());
                }
                context.Actors.Add(objActor);
                context.SaveChanges();
                return(RedirectToAction("GetMovies", "Imdb", null));
            }
            return(RedirectToAction("AddActor", "Actor", null));
        }
        public override void Prepare()
        {
            var parser = new SimulationCaseParser();
            var result = parser.Parse(xml);

            ProcessInstance = result.ProcessInstance;
            Name            = result.Name;

            foreach (var actor in result.Actors)
            {
                Actors.Add(actor);
            }

            foreach (var chunk in result.Chunks)
            {
                AddChunk(chunk);
            }
        }
Esempio n. 32
0
    public override void StartEvent()
    {
        Text = "This is Scott's Phone. How can I help you?";
        ConversationActor = Actors.Phone_Scott();

        {
            var choice = NewEventChoice("CALLS");
            choice.AddNextEvent <Phone_Scott_CALLS_1>();
        }
        {
            var choice = NewEventChoice("MESSAGES");
            choice.AddNextEvent <Phone_Scott_MESSAGES_1>();
        }
        {
            var choice = NewEventChoice("SETTINGS");
            choice.AddNextEvent <Phone_Scott_SETTINGS_1>();
        }
    }
Esempio n. 33
0
        private void h_dispatchKey()
        {
            if (!IsPressed(VirtualKeyStates.Space))
            {
                return;
            }
            if (m_frameCount % 10 != 0)
            {
                return;
            }
            Bullet bullet = new Bullet(this)
            {
                Position = Player.Position
            };

            bullet.Load();
            Actors.Add(bullet);
        }
Esempio n. 34
0
    public override void PlayEvent()
    {
        Text       = "Hi, and welcome to Glass VR. Put me on. You won't regret it. Trust me.";
        EventActor = Actors.Headset();

        {
            var choice = NewChoice("NOTIFICATIONS");
            choice.AddNextEvent <VR_Interaction_B_1>();
        }
        {
            var choice = NewChoice("INSTALLED APPS");
            choice.AddNextEvent <VR_Interaction_A_1>();
        }
        {
            var choice = NewChoice("SETTINGS");
            choice.AddNextEvent <VR_Interaction_C_1>();
        }
    }
        public void PushRoleStartingInteraction(Actors.Sim sim)
        {
            try
            {

                //Message.Sender.Show("PushRoleStartingInteraction to " + (sim != null ? sim.FullName : "null"));
                if (sim != null)
                {
                    if (sim.LotCurrent == null || sim.LotCurrent != this.LotCurrent)
                    {
                        HomeBartender.forceSimToLot(sim);
                    }
                    else
                    {
                        LetSimIn(sim);
                        List<BarProfessional> bars = this.LotCurrent.GetObjectsInRoom<BarProfessional>(this.RoomId);
                        BarProfessional theBar = null;

                        foreach (BarProfessional bar in bars)
                        {
                            if (!isBarManned(bar))
                            {
                                theBar = bar;
                                break;
                            }
                        }

                        if (theBar != null)
                        {
                            InteractionInstance instance = TendHomeBar.Singleton.CreateInstance(theBar, sim,
                                new InteractionPriority(InteractionPriorityLevel.CriticalNPCBehavior), false, false);
                            sim.InteractionQueue.AddAfterCheckingForDuplicates(instance);

                        }

                    }
                }
            }
            catch (Exception ex)
            {

            }
        }
Esempio n. 36
0
        public override ActionResult Process(Actors.Actor actor, Game game)
        {
            int newX = RTools.GetX(actor.X, Direction);
            int newY = RTools.GetY(actor.Y, Direction);

            if (!game.Map.CheckLimits(newX, newY))
            {
                return ActionResult.Fail;
            }

            Attacker = actor;
            Defender = game.Map.GetTile(newX, newY).Actor;

            if (Defender == null)
            {
                return ActionResult.Fail;
            }

            Damage = CalculateDamage(Attacker, Attack, Defender);
            Defender.Hurt(Damage);
            return ActionResult.Success;
        }
 public List<ISpell> extractSpellsFromHands(Actors.Hand right, Actors.Hand left)
 {
     Array enumValues = System.Enum.GetValues(typeof(Spell.spellsComboEnum));
     foreach (Spell.spellsComboEnum enumVal in enumValues)
      {
        switch (enumVal) {
             case Spell.spellsComboEnum.DSFFFc :
                 addSpellToList(Disease.generatedBy(right, left));
                 break;
             case Spell.spellsComboEnum.DSF:
                 addSpellToList(Confusion.generatedBy(right, left));
                 break;
             case Spell.spellsComboEnum.WPP :
                 addSpellToList(CounterSpell.generatedBy(right, left));
                 break;
             case Spell.spellsComboEnum.WWS:
                 addSpellToList(CounterSpell.generatedBy(right, left));
                 break;
             default:
                 break;
         }
      }
      return spellsToChooseFrom;
 }
Esempio n. 38
0
 public override ActionResult Process(Actors.Actor actor, Game game)
 {
     throw new NotImplementedException();
 }
 public void AddRoleGivingInteraction(Actors.Sim sim)
 {
     this.mShowIndex = 0;
     calculateNextShowTime();
     base.AddInteraction(StartShowNow.Singleton);
 }
Esempio n. 40
0
 public Spell(Actors.Actor aCaster, Actors.Actor aTarget, int force)
 {
     this.caster = aCaster;
     this.target = aTarget;
     this.damage = force;
 }
Esempio n. 41
0
 public override ActionResult Process(Actors.Actor actor, Game game)
 {
     return ActionResult.Success;
 }
 public CounterSpell(Actors.Hand aHand)
     : base(aHand.Owner, aHand.target, force)
 {
     //   this.hand = aHand;
 }
 public void PushRoleStartingInteraction(Actors.Sim sim)
 {
     try
     {
         if (sim != null && this.mNextShowTime <= SimClock.CurrentTicks)
         {
             if (Message.Sender.IsDebugging())
             {
                 Message.Sender.Debug(this, "It is SHOWTIME");
             }
             calculateNextShowTime();
             PushSimToPerformShow(sim);
         }
     }
     catch (Exception ex)
     {
         Message.Sender.ShowError(this, "Sim cannot play the role", false, ex);
     }
 }
 public void RemoveRoleGivingInteraction(Actors.Sim sim)
 {
 }
        public void PushRoleStartingInteraction(Actors.Sim sim)
        {
            try
            {

                //Message.Sender.Show("PushRoleStartingInteraction to " + (sim != null ? sim.FullName : "null"));
                if (sim != null && GetTargetLot().IsCommunityLot)
                {
                    IBarProfessional bar = findNearestBar(sim);
                    if (bar != null && bar.InUse)
                    {
                        Bartending.DrinkDescription bestDrink = Bartending.GetBestDrinkFor(sim, base.LotCurrent.GetMetaAutonomyType);
                        String bestDrinkName = null;
                        if (bestDrink != null)
                        {
                            bestDrinkName = bestDrink.GetLocalizedName();
                        }

                        if (bestDrinkName != null)
                        {
                            PushSimToDrink(sim, bar, bestDrinkName);

                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Message.Sender.ShowError(this, "Cannot order drink from bar ", false, ex);
            }
        }
Esempio n. 46
0
 public CauseWounds(Actors.Actor aCaster, Actors.Actor aTarget, int force)
     : base(aCaster, aTarget, force)
 {
 }
        private void PushSimToDrink(Actors.Sim sim, IBarProfessional bar, String bestDrinkName)
        {
            List<InteractionObjectPair> interactions = bar.GetAllInteractionsForActor(sim);
            InteractionDefinition drinkingDefinition = null;
            foreach (InteractionObjectPair interaction in interactions)
            {
                InteractionDefinition interactionDef = interaction.InteractionDefinition;
                string name = interactionDef.GetInteractionName(sim, bar, interaction);

                if (name != null && name.Contains(bestDrinkName))
                {
                    drinkingDefinition = interactionDef;
                    break;
                }
            }

            if (drinkingDefinition != null)
            {

                IEnumerable<InteractionInstance> actions = sim.InteractionQueue.InteractionList;
                List<InteractionInstance> toCancel = new List<InteractionInstance>();
                bool alreadyDrinking = false;
                foreach (InteractionInstance action in actions)
                {
                    if (!(action is BarProfessional.BarInteraction))
                    {

                        toCancel.Add(action);
                    }
                    else
                    {

                        alreadyDrinking = true;
                        break;
                    }

                }

                foreach (InteractionInstance action in toCancel)
                {
                    sim.InteractionQueue.CancelInteraction(action, false);
                }
                if (!alreadyDrinking)
                {
                    sim.InteractionQueue.AddAfterCheckingForDuplicates(drinkingDefinition.CreateInstance(bar, sim, new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), true, false));

                }
            }
        }
 private IBarProfessional findNearestBar(Actors.Sim sim)
 {
     return GlobalFunctions.GetClosestObject<BarProfessional>(sim, false, true, new List<BarProfessional>(), null);
 }
        private void PushSimToDrink(Actors.Sim sim, IBarProfessional bar, String bestDrinkName)
        {
            if (Message.Sender.IsDebugging())
            {
                Message.Sender.Debug(this, "Best drink for " + sim.FullName + " is: " + bestDrinkName);
            }
            List<InteractionObjectPair> interactions = bar.GetAllInteractionsForActor(sim);
            InteractionDefinition drinkingDefinition = null;
            foreach (InteractionObjectPair interaction in interactions)
            {
                InteractionDefinition interactionDef = interaction.InteractionDefinition;
                string name = interactionDef.GetInteractionName(sim, bar, interaction);

                if (name != null && name.Contains(bestDrinkName))
                {
                    drinkingDefinition = interactionDef;
                    break;
                }
            }

            if (drinkingDefinition != null)
            {

                IEnumerable<InteractionInstance> actions = sim.InteractionQueue.InteractionList;
                List<InteractionInstance> toCancel = new List<InteractionInstance>();
                bool alreadyDrinking = false;
                foreach (InteractionInstance action in actions)
                {
                    if (!(action is BarProfessional.BarInteraction))
                    {
                        if (Message.Sender.IsDebugging())
                        {
                            Message.Sender.Debug(this, "Canceling " + action.GetInteractionName());
                        }
                        toCancel.Add(action);
                    }
                    else
                    {
                        if (Message.Sender.IsDebugging())
                        {
                            Message.Sender.Debug(this, "Sim is already drinking, no push added");
                        }
                        alreadyDrinking = true;
                        break;
                    }

                }

                foreach (InteractionInstance action in toCancel)
                {
                    sim.InteractionQueue.CancelInteraction(action, false);
                }
                if (!alreadyDrinking)
                {
                    sim.InteractionQueue.AddAfterCheckingForDuplicates(drinkingDefinition.CreateInstance(bar, sim, new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), true, false));
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, "Sim was pushed to drink: " + sim.FullName);
                    }
                }
            }
        }
 private IToilet findNearestToilet(Actors.Sim sim)
 {
     return GlobalFunctions.GetClosestObject<IToilet>(sim, true, true, new List<IToilet>(), null);
 }
Esempio n. 51
0
        public void Load(Actors.Player mainPlayer)
        {
            var game = GameEngine.Singleton.GetPlayState();

            if (game.ActiveMap != null &&
                game.ActiveMap.UnLoaded != null)
                game.ActiveMap.UnLoaded(game.ActiveMap);

            MainPlayer = mainPlayer;
            this.AddGameObject(MainPlayer);
            game.ActiveMap = this;
            game.Reload();

            if (Loaded != null)
                Loaded(this);
        }
 public void AddRoleGivingInteraction(Actors.Sim sim)
 {
 }
Esempio n. 53
0
 public void addFighter(Actors.Actor fighter)
 {
     this.FightersList.Add(fighter);
 }
Esempio n. 54
0
 public Shield(Actors.Hand aHand)
     : base(aHand.Owner, aHand.target, force)
 {
     this.spellType = Spell.spellsTypeEnum.protection;
 }
Esempio n. 55
0
 //        private Actors.Hand hand;
 public Amnesia(Actors.Hand aHand)
     : base(aHand.Owner, aHand.target, force)
 {
     this.spellType = Spell.spellsTypeEnum.Enchantment;
 }
Esempio n. 56
0
 public Shield(Actors.Actor aCaster, Actors.Actor aTarget, int force)
     : base(aCaster, aTarget, force)
 {
 }
        public void PushSimToPerformShow(Actors.Sim sim)
        {
            if (sim != null)
            {
                ExoticDancer currentRole = this.CurrentRole as ExoticDancer;
                if (currentRole != null)
                {
                    currentRole.FreezeMotivesWhilePlaying();
                    //pushSimToPeeBeforeShow(sim);

                    InteractionInstance instance = PerformShow.Singleton.CreateInstance(this, sim,
                        new InteractionPriority(InteractionPriorityLevel.RequiredNPCBehavior), false, false);
                    sim.InteractionQueue.AddAfterCheckingForDuplicates(instance);
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, sim.FullName + " pushed to dance");
                    }
                }
            }
        }
 public void RemoveRoleGivingInteraction(Actors.Sim sim)
 {
     base.RemoveInteractionByType(StartShowNow.Singleton.GetType());
 }
Esempio n. 59
0
 public FireStorm(Actors.Actor aCaster, Actors.Actor aTarget, int force)
     : base(aCaster, aTarget, force)
 {
 }
 public void PushRoleStartingInteraction(Actors.Sim sim)
 {
 }