public LameShip getShip() { if (ship == null) { ship = GetComponentInParent <LameShip>(); } return(ship); }
void OnCollisionExit(Collision collisionInfo) { LameShip ship = collisionInfo.gameObject.GetComponentInParent <LameShip>(); //Just do not take damage if player is docked if (ship != null) { if (ship.DockingPort != null) { modHP(Mathf.Round(collisionInfo.relativeVelocity.magnitude * CollisionDamage)); } //meh, docking to anything it's fine. } }
public Transform[] getPoints() { LameShip ship = PlayerControls.getPlayerShip(); Transform[] points = null; if (ship != null) { return(ship.hardPoints); } //return gun controller if no points assigned points = new Transform[1]; points[0] = this.transform; return(points); }
public bool isOnPlayerShip() { LameShip ship = GetComponentInParent <LameShip>(); PlayerControls player = PlayerControls.GetActivePlayer(); if (player != null) { if (player.activeVessel == ship) { return(true); } if (ship.pilot == LameShip.shipController.player) { return(true); } } return(false); }
public static bool areFriendly(LameShip shipA, LameShip shipB) { return(!shipA.isHostile(shipB)); }
public static bool areHostile(LameShip shipA, LameShip shipB) { return(shipA.isHostile(shipB)); }
public bool isFriendly(LameShip mobToCheck) { return(!isHostile(mobToCheck.iff)); }
//public bool isFriendly(int iffCode) //{ // return false; //} public bool isHostile(LameShip mobToCheck) { return(isHostile(mobToCheck.iff)); }