private void handleGravity(float delta) { // This particular value needs to be multiplied by delta to ensure // framerate independence if (InUpdraft && Umbrella.Deployed) { velocity.y -= GRAVITY * delta * (juniInput.JumpHeld ? UPDRAFT_FORCE_HOLD : UPDRAFT_FORCE); velocity.y = Mathf.Max(juniInput.JumpHeld ? MAX_UPDRAFT_SPEED_HOLD : MAX_UPDRAFT_SPEED, velocity.y); } else { if (!Grounded) { velocity.y += GRAVITY * delta; } else { velocity.y = GRAVITY * delta; } if (juniInput.JumpHeld) { var jump_hold = Powers.getPower(PowerNames.HighJump) ? HIGH_JUMP_HOLD_POWER : JUMP_HOLD_POWER; if (Umbrella.Deployed) { jump_hold *= UMBRELLA_JUMP_HOLD_PENALTY; } velocity.y -= jump_hold * delta; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Powers.HasAuth(LoginUser.Auths, AuthType.SEP, Powers.A601)) { throw new Exception("没有权限访问"); } }
public static Power GetInstance(Powers pow, Slider slider) { switch (pow) { case Powers.Boom: return(new BoomPower(slider)); case Powers.SlowTime: return(new SlowTime(slider)); case Powers.United: return(new UnitedPower(slider)); case Powers.Laser: return(new LaserPower(slider, 5f)); case Powers.Invincible: return(new InvinciblePower(slider)); case Powers.Ultimate: return(new UltimatePower(slider)); default: return(null); } }
protected override void Validation() { if (_NewAccount.Id == _LoginUser.Id) { return; } //权限验证 if (!Powers.HasAuth(_LoginUser.Auths, AuthType.SEP, Powers.A101)) { throw MessageKeys.AppException(MessageKeys._NoAuth); } //用户名唯一性验证 if (DalInstance.AccountDalInstance.ValidationLoginName(_NewAccount.Id, _NewAccount.LoginName)) { throw MessageKeys.AppException(MessageKeys._Account_Not_Repeat); } //姓名唯一性验证 if (DalInstance.AccountDalInstance.ValidationName(_NewAccount.Id, _NewAccount.Name)) { throw MessageKeys.AppException(MessageKeys._Employee_Name_Repeat); } }
public override void CheckPower() { if (player.PowerUp != null) { power = player.PowerUp.GetComponent <Powers>(); string PowerUpName = player.PowerUp.name; if (PowerUpName == "Boots") { power.Activate(); player.SuperSpeedOn = true; player.map.BootsUI.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f); player.PowerUp.gameObject.SetActive(false); player.SetAnimations(); player.PowerUp.Interact(); player.RemoveFocus(); player.Invoke("SPOff", 5f); } else if (PowerUpName == "Shield") { power.Activate(); player.InvulOn(); player.map.ShieldUI.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f); player.PowerUp.gameObject.SetActive(false); player.PowerUp.Interact(); player.RemoveFocus(); player.Invoke("InvulOff", 5f); } } }
public void SetPowers(Powers powers) { StopAllCoroutines(); SetNormalState(); switch (powers.Index()) { case 0: StartCoroutine(SetLargerBall()); break; case 1: StartCoroutine(SetSmallerAndSemiTransparentBall()); break; case 2: StartCoroutine(SetLargerPaddle()); break; case 3: StartCoroutine(SetSmallerPaddle()); break; default: Debug.LogError("Invalid powers"); break; } StartCoroutine(SetLargerBall()); }
public void SetPowers(Powers pow) { for (int i = 0; i < GameManager.MAXPOWER; i++) { if (pow == Powers.jump) { if (i < GameManager.numOfJumps) { buttonsJump [i].fillCenter = true; } else { buttonsJump [i].fillCenter = false; } } if (pow == Powers.shield) { if (i < GameManager.numOfShields) { buttonsShield [i].fillCenter = true; } else { buttonsShield [i].fillCenter = false; } } } }
protected void SetPower(Powers powerName) { GetComponent <Player>().activeEvolutions++; evolution = GameManager.EvolutionManager.GetEvolutionByPowerName(powerName, true); if ((int)evolution.BodyPart < transform.GetChild((int)PlayerChildren.SlimeMesh).childCount) { affectedPart = transform.GetChild((int)PlayerChildren.SlimeMesh).GetChild((int)evolution.BodyPart).gameObject; } if (evolution.BodyPart == BodyPart.Hammer) { affectedPart.transform.SetParent(transform.GetChild((int)PlayerChildren.SlimeMesh).GetChild(0).GetChild(0).GetChild(0)); } else if (evolution.BodyPart == BodyPart.Staff) { affectedPart.transform.SetParent(transform.GetChild((int)PlayerChildren.SlimeMesh).GetChild(0).GetChild(0).GetChild(1)); } else if (evolution.BodyPart == BodyPart.Ghost) { //Change player appearence ((EvolutionGhost)(this)).SetGhostVisual(); //Then do Nothing affectedPart = transform.gameObject; } affectedPart.SetActive(true); Timer = evolution.duration; playerController = GetComponent <PlayerController>(); }
public UnitMove GetBuildMove(string mapNodeName, UnitType unitType) { Unit unit; MapNode mapNode = MapNodes.Get(mapNodeName); OccupiedMapNodes.TryGetValue(mapNode, out unit); if (unit != null) { throw new ArgumentException($"A {unit.Power} {unit.UnitType} unit occupies {mapNodeName} "); } if (!mapNode.Territory.IsSupplyCenter) { throw new ArgumentException($"Can't build in {mapNode.Territory} because it's not a supply center"); } if (!OwnedSupplyCenters.Any(kvp => kvp.Value.Contains(mapNode.Territory))) { throw new ArgumentException($"No power controls {mapNode.Territory}"); } Powers power = OwnedSupplyCenters.Where(kvp => kvp.Value.Contains(mapNode.Territory)).First().Key; var edge = Maps.BuildMap.AdjacentOutEdges(MapNodes.Get("build")).First(e => e.Target == mapNode); if (unitType == UnitType.Army) { unit = Army.Get(power); } else { unit = Fleet.Get(power); } UnitMove uBuild = new UnitMove(unit, edge); return(uBuild); }
/// <inheritdoc /> public SMSG_POWER_UPDATE_Payload(PackedGuid unitGuid, Powers powerType, int newValue) : this() { UnitGuid = unitGuid; PowerType = powerType; NewValue = newValue; }
public void UpdateSpecial() { if (CurrentPlayer.isDead) { CurrentPlayer.remove_condition_in_player(id_condition); return; } if (!isReadyToUse) { return; } float _tick = (float)DateTime.Now.Subtract(TimeOfStartForSpecial).TotalSeconds; if (isSpecialActive && _tick > DefaultContinuityOfSpecial) { EndTickAndRemove(); } else if (isSpecialActive && !(_tick > DefaultContinuityOfSpecial)) { UpdateTimer(DefaultContinuityOfSpecial - _tick); } if (!isSpecialActive && (float)DateTime.Now.Subtract(TimeOfEndForSpecial).TotalSeconds > TimeTillNextSpecial) { TimeOfStartForSpecial = DateTime.Now; isSpecialActive = true; CurrentActivePower = GetSpecial(); UpdateConditions(); } }
public void MaybeAddPower(SurvivorPower power, double chance) { if (!Powers.HasFlag(power) && Utils.RANDOM.NextDouble() >= chance) { Powers &= power; } }
protected void Page_Load(object sender, EventArgs e) { if (!Powers.HasAuth(LoginUser.Auths, AuthType.HRMIS, HrmisPowers.A108)) { throw new ApplicationException("没有权限访问"); } }
public Villain(string name, Powers power) : base(name, power) { this.Name = name; this.superCostume = new Costume(power); this.Punchline = String.Format("My name is {0}, my super power is {1} and I will destroy the world !!!", name, power); }
public void Populate(Board board, FeatureMeasurementCollection featureMeasurementCollection) { foreach (var edge in Maps.Full.Edges) { Unit unit1 = board.OccupiedMapNodes.FirstOrDefault(kvp => kvp.Key.Territory.ShortName == edge.Source.ShortName).Value; Powers owningPower1 = board.OwnedSupplyCenters.Where(kvp => kvp.Value.Any(t => t.ShortName == edge.Source.Territory.ShortName)).FirstOrDefault().Key; DrawnMapNode from = GetDrawnMapNode(edge.Source, unit1, owningPower1); Unit unit2 = board.OccupiedMapNodes.FirstOrDefault(kvp => kvp.Key.Territory.ShortName == edge.Target.ShortName).Value; Powers owningPower2 = board.OwnedSupplyCenters.Where(kvp => kvp.Value.Any(t => t.ShortName == edge.Target.Territory.ShortName)).FirstOrDefault().Key; DrawnMapNode to = GetDrawnMapNode(edge.Target, unit2, owningPower2); DrawnMapEdge drawnEdge = new DrawnMapEdge(from, to); DrawnMapEdge drawnEdgeInverse = new DrawnMapEdge(to, from); if (!ContainsVertex(from)) { AddVertex(from); AddFeatureValueText(from, featureMeasurementCollection); } if (!ContainsVertex(to)) { AddVertex(to); AddFeatureValueText(to, featureMeasurementCollection); } if (!ContainsEdge(drawnEdge) && !ContainsEdge(drawnEdgeInverse)) { AddEdge(drawnEdge); } } }
private static void GetWinterBoardMovesDisbandsOnlyRecursive(Board originalBoard, BoardMove workingBoardMove, IEnumerable <UnitMove> availableMoves, HashSet <BoardMove> completedBoardMoves, PowersDictionary <int> buildDisbandCounts, int minMoves) { if (workingBoardMove.Count == minMoves) { completedBoardMoves.Add(workingBoardMove.Clone()); return; } var moveGrouping = availableMoves.ToLookup(um => um.Unit.Power); Powers power = availableMoves.First().Unit.Power; IEnumerable <UnitMove> remainingMoves; foreach (UnitMove unitMove in moveGrouping[power]) { if (workingBoardMove.Count(um => um.Unit.Power == power) == Math.Abs(buildDisbandCounts[power])) { remainingMoves = availableMoves.Where(um => um.Unit.Power != power); } else { remainingMoves = availableMoves.Where(um => um != unitMove); } BoardMove newBoardMove = workingBoardMove.Clone(); newBoardMove.Add(unitMove); GetWinterBoardMovesDisbandsOnlyRecursive(originalBoard, newBoardMove, remainingMoves, completedBoardMoves, buildDisbandCounts, minMoves); } }
private void Start() { slider = GameObject.Find("Slider").GetComponent <Slider>(); body = GetComponent <SpriteRenderer>(); player = GetComponent <CPPlayer>(); powers = GetComponent <Powers>(); }
public Superman() : base("Superman", "Clark Kent") { Powers.Add("Fly", new Fly()); Powers.Add("LaserVision", new LaserVision()); Powers["LaserVision"].UpgradeStrength(100); Powers["Punch"].UpgradeStrength(60); }
public static void Main11(string[] args) { var _in = decimal.Parse(args[0]); var _out = new Powers().Sqrt(_in); Console.Write("Sqrt [{0}] is [{1}]", _in, _out); }
// A power was dequeued to get here! void UsePower(Powers power) { switch (power) { case Powers.Shift: shifting = true; shiftTime = shiftStartTime; col.enabled = false; // Change colours Color curColor = sr.color; curColor.r = 0; curColor.b = 0; sr.color = curColor; //Trigger the jump animation anim.SetTrigger("Jump"); jumping = true; Debug.Log("Shift power!"); break; case Powers.JumpReset: jumping = false; break; } // A power was used, shift all powers one to the right for (int i = 0; i < 3; i++) { if (powerUI [i].GetPos() > 0) { powerUI [i].SetPos(powerUI [i].GetPos() - 1); } } }
public override void MakeHero() { Powers.Add(new Flight()); Powers.Add(new Strength()); Powers.Add(new Invulnerable()); Powers.Add(new HeatVision()); }
// beginning of program private void Generator() { printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage); btnMutate.Enabled = true; ClearForm(); // refreshes lists Animal.NewAnimals(); Powers.NewPowers(); Paths.NewPaths(); Gifts.NewGifts(); Background.NewBackgrounds(); Skills.NewSkills(); Story.NewStories(); // creates new blank character _character = Character.CreateDefaultCharacter(); // roll stats, background, skills and story _character.IsPhysical = Dice.FlipCoin(); _character.Stats = Dice.RollStats(_character.IsPhysical, _character.Stats); _character.Sanity = _character.Stats["Intelligence"] + _character.Stats["Willpower"]; _character.Background = Background.ChooseBackground(_character.IsPhysical, _character.Background); _character.Skills = Skills.AssignSkills(_character.Background.Skills, _character.Skills, _character.Background.SkillsLimit); _character.Story = Story.ChooseStory(_character.Background.ID); DisplayHuman(); }
public bool SetEvolutions(List <ExportEntry> availableEvolutions) { // 1. Calculate the number of required bonus evolutions var numToPick = Powers.Count(x => x.HasEvolution()) * 2; while (numToPick > 0) { var numAttempts = availableEvolutions.Count; var evolutionToCheck = new Talent(availableEvolutions.PullFirstItem(), true); while (numAttempts > 0 && EvolvedPowers.Any(x => x.PowerExport.InstancedFullPath == evolutionToCheck.PowerExport.InstancedFullPath)) // Ensure there are no duplicate power exports { // Repick availableEvolutions.Add(evolutionToCheck.BasePower); evolutionToCheck = new Talent(availableEvolutions.PullFirstItem(), true); numAttempts--; if (numAttempts == 0) { Debug.WriteLine("Could not find suitable evolution for talentset!"); return(false); // There is no viable solution } } EvolvedPowers.Add(evolutionToCheck); numToPick--; } return(true); }
public Evolution GetEvolutionByPowerName(Powers _powerName, bool isPermanent = false) { Evolution tmpEvolution; switch (_powerName) { case Powers.Strength: tmpEvolution = strengthEvolution; break; case Powers.Agile: tmpEvolution = agileEvolution; break; case Powers.Platformist: tmpEvolution = platformistEvolution; break; case Powers.Ghost: tmpEvolution = ghostEvolution; break; default: Debug.Log("Unknown power, something went wrong"); return(null); } if (isPermanent) { tmpEvolution.duration = 0.0f; } return(tmpEvolution); }
public Evolution(Powers _powerName, float _duration, CollectableType _associatedCollectable, int _cost, BodyPart _bodyPart) { id = (int)_powerName; duration = _duration; associatedCollectable = _associatedCollectable; cost = _cost; bodyPart = _bodyPart; }
internal Territory(string name, string shortName, bool isSupply, Powers homePower, TerritoryType territoryType) { Name = name; ShortName = shortName; IsSupplyCenter = isSupply; HomeSupplyPower = homePower; TerritoryType = territoryType; }
protected void Page_Load(object sender, EventArgs e) { if (!Powers.HasAuth(LoginUser.Auths, AuthType.HRMIS, HrmisPowers.A605)) { throw new ApplicationException("没有权限访问"); } new EmployeeWelfareSearchListPresenter(EmployeeWelfareSearchList1, LoginUser, IsPostBack); }
protected override void Validation() { //权限验证 if (!Powers.HasAuth(_LoginUser.Auths, AuthType.SEP, Powers.A503)) { throw MessageKeys.AppException(MessageKeys._NoAuth); } }
protected void Page_Load(object sender, EventArgs e) { if (!Powers.HasAuth(LoginUser.Auths, AuthType.HRMIS, HrmisPowers.A504)) { throw new ApplicationException("没有权限访问"); } new SearchEmployeeInAndOutInfoPresenter(PersonalInAndOutInfoView1, LoginUser).Initialize(IsPostBack); }
public List <Auth> GetAccountAllAuth(int accountId, Account loginUser) { if (!Powers.HasAuth(loginUser.Auths, AuthType.SEP, Powers.A103) && accountId != loginUser.Id) { throw MessageKeys.AppException(MessageKeys._NoAuth); } return(DalInstance.AuthDalInstance.GetAccountAuthTree(accountId)); }
public Mac() { Channels = new ChannelParams[16]; for (int id = 0; id < Channels.Length; ++id) Channels[id] = new ChannelParams(id, 0U, Datarates.DR_0, Datarates.DR_0, Bands.BAND_G1_0); Rx2Channel = new Rx2ChannelParams(0U, Datarates.DR_0); ChannelsMask = new ushort[6]; Channels[0].Frequency = 868100000U; Channels[0].DatarateRange.Value = (sbyte)80; Channels[0].Band = Bands.BAND_G1_1; Channels[1].Frequency = 868300000U; Channels[1].DatarateRange.Value = (sbyte)96; Channels[1].Band = Bands.BAND_G1_1; Channels[2].Frequency = 868500000U; Channels[2].DatarateRange.Value = (sbyte)80; Channels[2].Band = Bands.BAND_G1_1; Channels[3].Frequency = 867100000U; Channels[3].DatarateRange.Value = (sbyte)80; Channels[3].Band = Bands.BAND_G1_0; Channels[4].Frequency = 867300000U; Channels[4].DatarateRange.Value = (sbyte)80; Channels[4].Band = Bands.BAND_G1_0; Channels[5].Frequency = 867500000U; Channels[5].DatarateRange.Value = (sbyte)80; Channels[5].Band = Bands.BAND_G1_0; Channels[6].Frequency = 867700000U; Channels[6].DatarateRange.Value = (sbyte)80; Channels[6].Band = Bands.BAND_G1_0; Channels[7].Frequency = 867900000U; Channels[7].DatarateRange.Value = (sbyte)80; Channels[7].Band = Bands.BAND_G1_0; Channels[8].Frequency = 868800000U; Channels[8].DatarateRange.Value = (sbyte)119; Channels[8].Band = Bands.BAND_G1_2; ChannelsMask[0] = (ushort)7; ChannelsMask[1] = (ushort)0; ChannelsMask[2] = (ushort)0; ChannelsMask[3] = (ushort)0; ChannelsMask[4] = (ushort)0; ChannelsMask[5] = (ushort)0; ChannelsTxPower = Powers.TX_POWER_14_DBM; ChannelsDatarate = Datarates.DR_0; ChannelsNbTrans = (byte)1; MaxRxWindow = 3000000U; ReceiveDelay1 = 1000000U; ReceiveDelay2 = 2000000U; JoinAcceptDelay1 = 5000000U; JoinAcceptDelay2 = 6000000U; DutyCycleOn = true; PublicNetwork = true; DeviceClass = DeviceClasses.CLASS_A; DevicePhy = DevicePhys.EU868; }