public KnyttTrigger(KnyttPoint trigger_pos, SwitchID id) { Pos = trigger_pos; ID = id; AbsoluteTarget = true; prefix = "Trig"; }
public KnyttArea(KnyttPoint position, KnyttWorld world) { Warp = new KnyttWarp(this); this.World = world; this.Empty = true; this.Position = position; this.fetchAreaExtraData(); this.fetchFlagWarpData(); }
protected override void loadFromINI(KeyDataCollection data) { base.loadFromINI(data); FormattedPosition = new KnyttPoint(getIntINIValue(data, "SpawnX"), getIntINIValue(data, "SpawnY")); ObjectID = new KnyttPoint(getIntINIValue(data, "Bank"), getIntINIValue(data, "Object")); EffectOffset = new KnyttPoint(getIntINIValue(data, "EffectX"), getIntINIValue(data, "EffectY")); AsOne = getBoolINIValue(data, "AsOne", true); Repeat = getBoolINIValue(data, "Repeat", false); }
public KnyttShift(KnyttPoint area_pos, KnyttPoint shift_pos, SwitchID id) { AreaPos = area_pos; Pos = shift_pos; ID = id; AbsoluteTarget = false; // Relative by default AsOne = true; Repeat = true; prefix = "Shift"; }
protected override void loadFromINI(KeyDataCollection data) { base.loadFromINI(data); FormattedArea = new KnyttPoint(getIntINIValue(data, "XMap"), getIntINIValue(data, "YMap")); FormattedPosition = new KnyttPoint(getIntINIValue(data, "XPos"), getIntINIValue(data, "YPos")); Save = getBoolINIValue(data, "Save", false); StopMusic = getBoolINIValue(data, "StopMusic", true); Quantize = getBoolINIValue(data, "Quantize", true); StopMusic = getBoolINIValue(data, "StopMusic", false); Cutscene = getStringINIValue(data, "Cutscene"); FlagOn = JuniValues.Flag.Parse(getStringINIValue(data, "FlagOn")); FlagOff = JuniValues.Flag.Parse(getStringINIValue(data, "FlagOff")); Coin = getIntINIValue(data, "Coin"); Delay = getIntINIValue(data, "Time"); }
public KnyttPoint getWarpCoords(KnyttPoint new_area, KnyttPoint current_area) { if (new_area.x < current_area.x) { return(WarpLeft); } if (new_area.x > current_area.x) { return(WarpRight); } if (new_area.y > current_area.y) { return(WarpDown); } if (new_area.y < current_area.y) { return(WarpUp); } throw (new SystemException("Invalid warp!")); }
public KnyttTrigger(KnyttArea area, KnyttPoint shift_pos, SwitchID id) : this(shift_pos, id, area.ExtraData) { }
public KnyttTrigger(KnyttPoint trigger_pos, SwitchID id, KeyDataCollection data) : this(trigger_pos, id) { loadFromINI(data); }
public KnyttShift(KnyttArea area, KnyttPoint shift_pos, SwitchID id) : this(area.Position, shift_pos, id, area.ExtraData) { }
public KnyttShift(KnyttPoint area_pos, KnyttPoint shift_pos, SwitchID id, KeyDataCollection data) : this(area_pos, shift_pos, id) { loadFromINI(data); }
public int manhattanDistance(KnyttPoint point) { return(Math.Abs(point.x - x) + Math.Abs(point.y - y)); }
public KnyttPoint max(KnyttPoint point) { return(new KnyttPoint(Math.Max(point.x, x), Math.Max(point.y, y))); }
public void setAreaPosition(KnyttPoint location) { data["Positions"]["X Pos"] = location.x.ToString(); data["Positions"]["Y Pos"] = location.y.ToString(); }
public int getMapIndex(KnyttPoint coords) { return((coords.y - MinBounds.y) * Size.x + (coords.x - MinBounds.x)); }
// TODO: This logic needs refactoring when things are fleshed out public KnyttArea getArea(KnyttPoint coords) { bool out_of_bounds = coords.x <MinBounds.x || coords.x> MaxBounds.x || coords.y <MinBounds.y || coords.y> MaxBounds.y; return(out_of_bounds ? null : this.Map[getMapIndex(coords)]); }