public void SetUpVariables(PlayerBase pb, BulletManager bm, WeaponBase wb) { this.wb = wb; playerBase = pb; bulletManager = bm; animator = GetComponent<Animator>(); }
public bool GetBestPassToReceiver( PlayerBase passer, PlayerBase receiver, ref Vector3 passTarget, double force) { return false; }
internal Pass(IEnumerable<Card> cards, PlayerBase giver, PlayerBase receiver) { Cards = cards.ToList(); Giver = giver; Receiver = receiver; }
public HitResult(PlayerBase player, WeaponBase weapon) { var newEnergy = player.Energy - weapon.Effect; var deathValue = 0; NewEnergyOfPlayer = newEnergy <= deathValue ? deathValue : newEnergy; NameOfWeapon = weapon.Name; }
public GameController(IGameFactory game) { _random = new Random(10); _fighter = game.CreateFighter(); _victim = game.CreateVictim(); _weapon = game.CreateWeapon(); }
public IEnumerator GetDiceRollResult() { string _uuid; if (PlayerPrefs.HasKey ("uuid")) { _uuid = PlayerPrefs.GetString ("uuid"); } else { yield break; } string url = ConfURL.HOST_NAME+ConfURL.PLAYER_BASE_MAKE; WWWForm form = new WWWForm (); form.AddField ("UUID", _uuid); form.AddField ("JobID", SelectJob); WWW www = new WWW(url, form); yield return www; if (www.error != null) { Debug.Log ("error"); } else { Debug.Log ("success"); Debug.Log (www.text); var charaAPI = JsonUtility.FromJson<RollResult>(www.text); baseStatus = charaAPI.BaseStatus; status = charaAPI.Status; InputBaseStatus(baseStatus); InputStatus(status); submitBtn.gameObject.SetActive (true); } }
internal TrickView(Trick trick, PlayerBase beholder) { IsFirstTrick = trick.IsFirstTrick; PlayList = trick .Select(p => new PlayView(p, beholder)) .ToList(); }
public bool FindPass( PlayerBase passer, PlayerBase receiver, ref Vector3 passTarget, double force, double minPassingDistance) { return false; }
// Use this for initialization void Start () { pb = GetComponent<PlayerBase>(); transform = this.GetComponent<Transform>(); failed = false; _online = false; goOnline (); }
public void SetUpVariables(PlayerBase pb, BulletManager bm, WeaponBase wb) { transform.localScale = new Vector3(1.1f, 1.1f, 0); this.wb = wb; playerBase = pb; bulletManager = bm; animator = GetComponent<Animator>(); }
void Awake() { coinText = transform.FindChild("CoinText").GetComponent<Text>(); //Always load coin from dataPlayer countCoin = DataPlayer.getInstance().Coin; //coinText.text = countCoin.ToString(); coinText.text = (countCoin + countTempCoin).ToString(); playerBase = GameObject.Find("PlayerBase").GetComponent<PlayerBase>(); }
internal DealView(Deal deal, PlayerBase beholder) { PlayerList = deal .Players .Select(p => new PlayerView(p, beholder)) .ToList(); AreHeartsBroken = deal.AreHeartsBroken; IsOver = deal.IsOver; }
internal RelativeLocation GetRelativeLocation(PlayerBase first, PlayerBase second) { int i = _players.IndexOf(first); int j = _players.IndexOf(second); int location = j >= i ? j - i : j - i + _players.Count; return (RelativeLocation)location; }
public void SetUpVariables(PlayerBase pb, BulletManager bm) { playerBase = pb; bulletManager = bm; animator = GetComponent<Animator>(); string soundLoaderString = "Sounds/Weapon/"; carSound = Resources.Load(soundLoaderString + "flamethrower") as AudioClip; carCrashSound = Resources.Load(soundLoaderString + "einsteinSpecial_explode") as AudioClip; }
public void SetUpVariables(PlayerBase pb, BulletManager bm) { //WhiteT = transform.Find("WhiteT", false); //childRenderer = GetComponentInChildren<SpriteRenderer>(); WhiteT.gameObject.GetComponent<Renderer>().material.shader = Shader.Find("Unlit/Transparent"); playerBase = pb; bulletManager = bm; animator = GetComponent<Animator>(); explosionSound = Resources.Load<AudioClip>("Sounds/Weapon/einsteinSpecial_explode"); }
public void InputBaseStatus(PlayerBase baseStatus) { Strength.text = baseStatus.Strength.ToString(); Constitution.text = baseStatus.Constitution.ToString(); Power.text = baseStatus.Power.ToString(); Dextality.text = baseStatus.Dextality.ToString(); Appeal.text = baseStatus.Appeal.ToString(); Size.text = baseStatus.Size.ToString(); Intelligence.text = baseStatus.Intelligence.ToString(); Education.text = baseStatus.Education.ToString(); }
public bool isPassSafeFromeAllOpponents(Transform from,Vector3 to, PlayerBase reveive,PlayerBase opp, float passingForce) { PlayerBase[] opponents = pOppSoccerTeam.pMemberArray; foreach (PlayerBase Obj in opponents) { if (!isPassSafeFromOpponent(from, to, reveive, opp, passingForce)) return false; } return true; }
/////////////////////////////////////////////////////////////////////////////// // functions /////////////////////////////////////////////////////////////////////////////// // ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ void Awake () { if( instance == null ) { instance = this; // check if we have main menu options, and apply the options. GameObject options = GameObject.Find("MainMenuOptions"); if ( options ) { instance.multiPlayer = options.GetComponent<MainMenuOptions>().isMultiPlayer; Debug.Log("multi player = " + instance.multiPlayer ); GameObject.Destroy(options); } // GameObject goBoy = GameObject.FindWithTag("player_boy"); playerBoy = goBoy.GetComponent<PlayerBase>(); GameObject goGirl = GameObject.FindWithTag("player_girl"); playerGirl = goGirl.GetComponent<PlayerBase>(); // if ( startPoints.Length != 0 ) { int i = (int)(Random.value * (startPoints.Length-1)); PlacePlayerAtStartPoint(this.startPoints[i].transform); } else { Debug.LogError("Can't find start point"); } // init hud if ( screenPad == null ) { GameObject hud = null; hud_m.SetActiveRecursively(false); hud_s.SetActiveRecursively(false); if ( Game.IsMultiPlayer() ) hud = hud_m; else hud = hud_s; hud.SetActiveRecursively(true); if ( hud ) { screenPad = hud.GetComponent<ScreenPad>(); screenPad.Init(); } #if UNITY_IPHONE if ( Application.isEditor == false ) { DebugHelper.Assert( screenPad, "screenPad not found" ); } #endif } } }
public void createBullets(PlayerBase owner) { bullet = (GameObject)Resources.Load("Prefabs/Projectile"); for (int i = 0; i < 20; i++) { GameObject obj = (GameObject)Instantiate(bullet); prefabBullets.Add(obj); obj.transform.parent = gameObject.transform; obj.SetActive(false); Bullet bulletClass = obj.GetComponent<Bullet>(); bulletClass.owner = owner; } }
internal AbsoluteLocation GetAbsoluteLocation(PlayerBase player) { switch (_players.IndexOf(player)) { case 0: return AbsoluteLocation.South; case 1: return AbsoluteLocation.West; case 2: return AbsoluteLocation.North; case 3: return AbsoluteLocation.East; default: throw new ArgumentOutOfRangeException("player"); } }
void Awake() { if (Instance != null && Instance != this) { DestroyImmediate(gameObject); return; } Instance = this; DontDestroyOnLoad (gameObject); SetupLevel (); playerRef = GameObject.FindGameObjectWithTag ("Player").transform.GetComponent<Player> (); pBaseRef = GameObject.FindGameObjectWithTag ("PlayerBase").transform.GetComponent<PlayerBase> (); eBaseRef = GameObject.FindGameObjectWithTag ("EnemyBase").transform.GetComponent<EnemyBase> (); }
public void Setup() { _bus = new Moq.Mock<IModifierBus>(); _target = new Mock<IGameElement>(); var observable = new Mock<IObservable<IModifier>>(); _player = new PlayerBase(_bus.Object); _modifier = new Mock<IDirectModifier<IGameElement>>(); _modifier.SetupGet(m => m.Target).Returns(_target.Object); //SomePlayer p1 = new SomePlayer(_bus.Object); //SomePlayer p2 = new SomePlayer(_bus.Object); //IDirectModifier<IPlayer> g = new SomeMod(); //p1.HeaveModifier(new SomeMod()); }
public void SetUp(PlayerBase p) { player = p; weaponHandling = p.weaponHandling; color = p.playInfo.playerColor; playerColor = (Colors)Enum.Parse(typeof(Colors), UppercaseFirst(color)); sprite = p.playInfo.charEnum.ToString() + "_portrait"; sprite = sprite.ToLower(); SetupAvatar(sprite); ready = true; //name = GameObject.Find("name_"+color).GetComponent<Text>(); //hp = GameObject.Find("hp_" + color).GetComponent<Text>(); //ammo = GameObject.Find("ammo_" + color).GetComponent<Text>(); //name.text = p.playInfo.playerName; iconRenderer = transform.Find("weaponI_" + p.playInfo.playerColor).gameObject.GetComponent<SpriteRenderer>(); iconRenderer.sprite = Resources.Load<Sprite>("Sprites/HUD/" + "icon_" + p.playInfo.charEnum.ToString().ToLower() + "Pistol"); }
public void fire(FireProps fp, PlayerBase pb, WeaponBase wb) { this.pb = pb; this.fp = fp; this.wb = wb; fired = true; colider.enabled = true; nullAllAnimBools(); setBoolAnimator("flameStart", true); if (!pb.isAi) { chosenAudioSourceIndex = SoundManager.instance.PlaySingle(flamethrowerSound, true); } else if(pb.isAi && !soundLoop) { chosenAudioSourceIndex = SoundManager.instance.PlaySingle(flamethrowerSound, true); soundLoop = true; } }
// Use this for initialization void Start() { //JP pb = GetComponent<PlayerBase>(); //direction = transform.Find("Tesla1").GetComponent<PlayerBase>().direction; //direction = new Vector2(1, 0); bullets = new List<GameObject>(); //bullet = GameObject.Find("Prefabs/Electricity"); bullet = (GameObject)Resources.Load("Prefabs/Electricity"); pooledAmount = 5; for (int i=0; i < pooledAmount; i++) { GameObject obj = (GameObject)Instantiate(bullet); obj.transform.parent = gameObject.transform; obj.SetActive(false); //nastavenie toho, ze sa gulka nepouziva bullets.Add(obj); } }
private static string SnakeRestoreStr(TongueData previousTongueData, PlayerBase player) { return(GenericRestoreStr(previousTongueData, player)); }
public PlayerBehaviour(PlayerBase PlayerBase) { this.PlayerBase = PlayerBase; }
private static string DemonicPlayerStr(Tongue tongue, PlayerBase player) { return("A slowly undulating tongue occasionally slips from between your lips." + " It hangs nearly two feet long when you let the whole thing slide out, though you can retract it to appear normal."); }
protected virtual void Awake() { //get the reference of playmaker fsms. PlayMakerFSM[] fsms = GetComponents<PlayMakerFSM>(); foreach (PlayMakerFSM fsm in fsms) { if (fsm.FsmName == "FSM_Control") { FSM_Control = fsm; } if (fsm.FsmName == "FSM_Hit") { FSM_Hit = fsm; } if (fsm.FsmName == "FSM_Charge") { FSM_Charge = fsm; } } //initialize key variables. player = transform.GetComponent<PlayerBase>(); layer = GetComponent<exLayer>(); velocity = new Vector2(0, 0); comboLevel = 0; charMoveDir = MoveDir.Stop; downButton = BtnHoldState.None; initJumpSpeedStatic = jumpSpeed; initMoveSpeedStatic = moveSpeed; initAttackPowerStatic = attackPower; initInvincibleDuration = FSM_Hit.FsmVariables.GetFsmFloat("varInvincibleDuration").Value; currentPlatform = Game.instance.theBasePlatform; }
public void KillPlayer(PlayerBase player) { Vector2 targetPlayerPosition = new Vector2(player.posX, player.posY) ; targetObject = player.gameObject; SwitchToBestWeapon(); if (!safeFromMine) { safeFromMine = aiMovementLogic.MoveTo(safeLocation, 0.2f); } else { Vector2 bestShootSpot = GetBestShootSpot(targetPlayerPosition); if (aiBase.weaponHandling.activeWeapon.weaponType == WeaponEnum.mine) { DropMine(); } else if(tankActive || aiBase.weaponHandling.activeWeapon.weaponType == WeaponEnum.specialDaVinci) { aiBase.weaponHandling.fire(aiBase.direction); aiMovementLogic.MoveTo(targetPlayerPosition, 0.2f); try { WeaponSpecialDaVinciLogic tank = aiBase.gameObject.transform.parent.GetComponentInChildren<WeaponSpecialDaVinciLogic>(); tankActive = tank.update; } catch (Exception e) { tankActive = false; } } else { if (aiMovementLogic.MoveTo(bestShootSpot)) { if (aiMapLogic.GetObjectDirection(player.gameObject) != aiBase.direction) aiMapLogic.LookAt(player.gameObject); else { } if (aiWeaponLogic.CanShoot(aiBase.transform.position, aiBase.direction) && frameToShoot < Time.frameCount) { //if you fire last bullet, wait a second, then you can shoot again if (aiBase.weaponHandling.activeWeapon.ammo == 1) { frameToShoot = Time.frameCount + 30; } aiBase.weaponHandling.fire(aiBase.direction); } } else { } } } }
void Start() { _playerBase = GameObject.FindGameObjectWithTag(Tags.PLAYER).GetComponent<PlayerBase>(); }
public StandingState(PlayerBase player) : base(player) { }
void Start() { m_Player = GetComponent<PlayerBase> () as PlayerBase; }
private static string SnakePlayerStr(Tongue tongue, PlayerBase player) { return("A snake-like tongue occasionally flits between your lips, tasting the air."); }