public int initiative; // Represents your character’s ability to quickly attack when presented // with a hostile situation. At the beginning of each turn, each character // rolls for initiative just like in D n’ D. public void calculate(PrimaryStatistics stats, int level, int roll) { this.actionPoints = LHGCommon.getValueInRange(Math.Floor(stats.agility / 3.0) + Math.Floor(level / 3.0), 4, 27); this.criticalChance = LHGCommon.getValueInRange(stats.luck, 1, 10); this.hitPoints = LHGCommon.getValueInRange(20 + stats.vitality + (level * 3), 21, 120); this.resistance = LHGCommon.getValueInRange(5 + stats.vitality + (level / 2), 6, 30); this.accuracy = LHGCommon.getValueInRange(95 + stats.vision / 2, 95, 100); this.initiative = LHGCommon.getValueInRange(roll + stats.agility, 13, 22); }
public int speech; // Represents how good your character is at communicating with other // characters. Some characters can only be convinced to join you if // your speech skill level is high enough. public void calculate(PrimaryStatistics stats) { this.meleeWeapons = LHGCommon.getValueInRange(6 + (stats.strength * 2), 6, 100); this.guns = LHGCommon.getValueInRange(6 + (stats.agility * 2), 6, 100); this.explosives = LHGCommon.getValueInRange(6 + stats.agility + stats.vision, 6, 100); this.vehicularRepair = LHGCommon.getValueInRange(6 + (stats.utilization * 2), 6, 100); this.weaponMods = LHGCommon.getValueInRange(6 + stats.utilization + stats.resourcefulness, 6, 100); this.firstAid = LHGCommon.getValueInRange(6 + (stats.intelligence * 2), 6, 100); this.scavenge = LHGCommon.getValueInRange(6 + (stats.resourcefulness * 2), 6, 100); this.speech = LHGCommon.getValueInRange(6 + stats.intelligence + stats.vision, 6, 100); }
public bool selectCell(Vector3 vector, Color selectColor) { Hex hex = findHexAt(new Vector2(vector.X, vector.Z)); if (hex != null) { LHGCommon.printToConsole("Selected Hex", hex); hex.HexState.BackgroundColor = selectColor; return(true); } return(false); }
public Player createMainPlayer(string referenceName, string name, PrimaryStatistics stats) { LHGCommon.printToConsole("Creating main player " + name); Player player = createPlayerFromTemplate(referenceName); if (player.MyType == Player.Type.Human) { Human human = (Human)player; human.MyName = name; human.MyStats = stats; human.IsComputerControlled = false; human.IsMainPlayer = true; human.IsAlive = true; return(human); } return(null); }
private void showCameraProperties() { //set the offsets int hudXOffset = 80; int hudYOffset = 10; SpriteBatch spriteBatch = lhg.MySpriteBatch; spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); spriteBatch.Draw(cameraHUD, new Rectangle(hudXOffset, hudYOffset, hudXSize, hudYSize), Color.White); SpriteFont font = lhg.SmallFont; string targetAsString = LHGCommon.formatString("target", camera.Target); string distanceAsString = LHGCommon.formatString("distance", camera.Distance);; string positionAsString = LHGCommon.formatString("position", camera.Position); string directionAsString = LHGCommon.formatString("direction", camera.Direction); string yawAsString = LHGCommon.formatString("yaw", camera.Yaw); string pitchAsString = LHGCommon.formatString("pitch", camera.Pitch); int j = 0; spriteBatch.DrawString(font, targetAsString, new Vector2(hudXOffset + 5, hudYOffset + font.LineSpacing * (j)), Color.Yellow); j++; spriteBatch.DrawString(font, distanceAsString, new Vector2(hudXOffset + 5, hudYOffset + font.LineSpacing * (j)), Color.Yellow); j++; spriteBatch.DrawString(font, positionAsString, new Vector2(hudXOffset + 5, hudYOffset + font.LineSpacing * (j)), Color.Yellow); j++; spriteBatch.DrawString(font, directionAsString, new Vector2(hudXOffset + 5, hudYOffset + font.LineSpacing * (j)), Color.Yellow); j++; spriteBatch.DrawString(font, yawAsString, new Vector2(hudXOffset + 5, hudYOffset + font.LineSpacing * (j)), Color.Yellow); j++; spriteBatch.DrawString(font, pitchAsString, new Vector2(hudXOffset + 5, hudYOffset + font.LineSpacing * (j)), Color.Yellow); spriteBatch.End(); }
public void calculate(int level, int roll) { this.actionPoints = 2; this.initiative = LHGCommon.getValueInRange(roll, 13, 22); }