public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var actorPos = actor.CenterPosition; RangeCircleRenderable.DrawRangeCircle( wr, actorPos + new WVec(0, 0, VerticalTopOffset), Radius, 1, Color.Yellow, 0, Color.Yellow); RangeCircleRenderable.DrawRangeCircle( wr, actorPos + new WVec(0, 0, VerticalBottomOffset), Radius, 1, Color.Yellow, 0, Color.Yellow); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var verts = combatOverlayVerts.Select(v => wr.ScreenPosition(actor.CenterPosition + v.Rotate(actor.Orientation))); wcr.DrawPolygon(verts.ToArray(), 1, Color.Yellow); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { RangeCircleRenderable.DrawRangeCircle(wr, actor.CenterPosition, Radius, 1, Color.Yellow, 0, Color.Yellow); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var actorPos = actor.CenterPosition; var orientation = new WRot(actor.Orientation.Roll, actor.Orientation.Pitch, new WAngle(actor.Orientation.Yaw.Angle + (RotateToIsometry ? 128 : 0))); var targetablePositions = actor.TraitsImplementing<ITargetablePositions>(); if (ApplyToAllTargetablePositions && targetablePositions.Any()) { var positions = targetablePositions.SelectMany(tp => tp.TargetablePositions(actor)); foreach (var pos in positions) { var vertsTop = combatOverlayVertsTop.Select(v => wr.Screen3DPosition(pos + v.Rotate(orientation))); var vertsBottom = combatOverlayVertsBottom.Select(v => wr.Screen3DPosition(pos + v.Rotate(orientation))); wcr.DrawPolygon(vertsTop.ToArray(), 1, Color.Yellow); wcr.DrawPolygon(vertsBottom.ToArray(), 1, Color.Yellow); } } else { var vertsTop = combatOverlayVertsTop.Select(v => wr.Screen3DPosition(actorPos + v.Rotate(orientation))); var vertsBottom = combatOverlayVertsBottom.Select(v => wr.Screen3DPosition(actorPos + v.Rotate(orientation))); wcr.DrawPolygon(vertsTop.ToArray(), 1, Color.Yellow); wcr.DrawPolygon(vertsBottom.ToArray(), 1, Color.Yellow); } }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var actorPos = actor.CenterPosition; var a = actorPos + new WVec(PointA.X, PointA.Y, VerticalTopOffset).Rotate(actor.Orientation); var b = actorPos + new WVec(PointB.X, PointB.Y, VerticalTopOffset).Rotate(actor.Orientation); var aa = actorPos + new WVec(PointA.X, PointA.Y, VerticalBottomOffset).Rotate(actor.Orientation); var bb = actorPos + new WVec(PointB.X, PointB.Y, VerticalBottomOffset).Rotate(actor.Orientation); var offset1 = new WVec(a.Y - b.Y, b.X - a.X, 0); offset1 = offset1 * Radius.Length / offset1.Length; var offset2 = new WVec(aa.Y - bb.Y, bb.X - aa.X, 0); offset2 = offset2 * Radius.Length / offset2.Length; var c = Color.Yellow; RangeCircleRenderable.DrawRangeCircle(wr, a, Radius, 1, c, 0, c); RangeCircleRenderable.DrawRangeCircle(wr, b, Radius, 1, c, 0, c); wcr.DrawLine(new[] { wr.Screen3DPosition(a - offset1), wr.Screen3DPosition(b - offset1) }, 1, c); wcr.DrawLine(new[] { wr.Screen3DPosition(a + offset1), wr.Screen3DPosition(b + offset1) }, 1, c); RangeCircleRenderable.DrawRangeCircle(wr, aa, Radius, 1, c, 0, c); RangeCircleRenderable.DrawRangeCircle(wr, bb, Radius, 1, c, 0, c); wcr.DrawLine(new[] { wr.Screen3DPosition(aa - offset2), wr.Screen3DPosition(bb - offset2) }, 1, c); wcr.DrawLine(new[] { wr.Screen3DPosition(aa + offset2), wr.Screen3DPosition(bb + offset2) }, 1, c); }
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor) { var a = actor.CenterPosition + new WVec(PointA.X, PointA.Y, 0).Rotate(actor.Orientation); var b = actor.CenterPosition + new WVec(PointB.X, PointB.Y, 0).Rotate(actor.Orientation); var offset = new WVec(a.Y - b.Y, b.X - a.X, 0); offset = offset * Radius.Length / offset.Length; var c = Color.Yellow; RangeCircleRenderable.DrawRangeCircle(wr, a, Radius, 1, c, 0, c); RangeCircleRenderable.DrawRangeCircle(wr, b, Radius, 1, c, 0, c); wcr.DrawLine(new[] { wr.ScreenPosition(a - offset), wr.ScreenPosition(b - offset) }, 1, c); wcr.DrawLine(new[] { wr.ScreenPosition(a + offset), wr.ScreenPosition(b + offset) }, 1, c); }
void DrawArmaments(Actor self, AttackBase attack, WorldRenderer wr, RgbaColorRenderer wcr, float iz) { var c = Color.White; // Fire ports on garrisonable structures var garrison = attack as AttackGarrisoned; if (garrison != null) { var bodyOrientation = coords.Value.QuantizeOrientation(self, self.Orientation); foreach (var p in garrison.Info.Ports) { var pos = self.CenterPosition + coords.Value.LocalToWorld(p.Offset.Rotate(bodyOrientation)); var da = coords.Value.LocalToWorld(new WVec(224, 0, 0).Rotate(WRot.FromYaw(p.Yaw + p.Cone)).Rotate(bodyOrientation)); var db = coords.Value.LocalToWorld(new WVec(224, 0, 0).Rotate(WRot.FromYaw(p.Yaw - p.Cone)).Rotate(bodyOrientation)); var o = wr.ScreenPosition(pos); var a = wr.ScreenPosition(pos + da * 224 / da.Length); var b = wr.ScreenPosition(pos + db * 224 / db.Length); wcr.DrawLine(o, a, iz, c); wcr.DrawLine(o, b, iz, c); } return; } foreach (var a in attack.Armaments) { foreach (var b in a.Barrels) { var muzzle = self.CenterPosition + a.MuzzleOffset(self, b); var dirOffset = new WVec(0, -224, 0).Rotate(a.MuzzleOrientation(self, b)); var sm = wr.ScreenPosition(muzzle); var sd = wr.ScreenPosition(muzzle + dirOffset); wcr.DrawLine(sm, sd, iz, c); TargetLineRenderable.DrawTargetMarker(wr, c, sm); } } }