package PlayerClass import HeroClass import Setup import HashMap public Player lastp = null constant real camDistance = 3000. constant real camAngle = 10. constant real camWidth = 1000. constant real camHeightLow = 2000 constant real camHeightHigh = -200 public constant HashMap playerData = new HashMap() init SetTerrainFogEx(0, 40000, 40000, 0, 0, 0, 0) SetCameraField(CAMERA_FIELD_FARZ, 100000, 0) FogMaskEnable(false) FogEnable(false) //SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, (5.428).asAngleRadians().degrees(), 10) public class Player player p Hero h = null string team = team1 int kills = 0 int assists = 0 int death = 0 boolean selectionOn = false //Cammera Settings timer camSet = getTimer() real sightfield = 40 real perspektiv = 295 construct(player p) lastp = this this.p = p camSet.startPeriodic(1., function setCam) camSet.setData(this castTo int) playerData.put(p, this) static function setCam() timer t = GetExpiredTimer() var obj = t.getData() castTo thistype // print("target = " + vec3(GetCameraTargetPositionX(), GetCameraTargetPositionY(), GetCameraTargetPositionZ()).toString()) // print("eye = " + vec3(GetCameraEyePositionX(), GetCameraEyePositionY(), GetCameraEyePositionZ()).toString()) // print("perspektive = " + GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK).toString()) // SetCameraFieldForPlayer(obj.p, CAMERA_FIELD_TARGET_DISTANCE, camDistance, 0.05) // SetCameraFieldForPlayer(obj.p, CAMERA_FIELD_ANGLE_OF_ATTACK, obj.perspektiv ,0.05) // SetCameraFieldForPlayer(obj.p, CAMERA_FIELD_FIELD_OF_VIEW, obj.sightfield, 0.05) /** * Does not correctly work atm */ function isCamOnHero() returns boolean if h != null print("rightcall") return not(GetCameraEyePositionX() + camWidth < h.u.getX() or GetCameraEyePositionX() - camWidth > h.u.getX() or GetCameraEyePositionY() + camHeightHigh < h.u.getY() or GetCameraEyePositionY() + camHeightLow > h.u.getY()) else return false endpackage