public void Deserialize(BinaryReader reader) { PerHourChange = reader.ReadInt16(); MaxValue = reader.ReadInt16(); Motive = (VMMotive)reader.ReadByte(); fractional = reader.ReadDouble(); }
public static int ScaleRate(VM vm, int rate, VMMotive type) { if (vm.TS1) { if (type == VMMotive.Energy) { rate *= (int)VMTS1MotiveDecay.Constants[0] / (24 - (int)VMTS1MotiveDecay.Constants[1]); } return(rate); } else { if (LotMotives == null) { LotMotives = Content.Content.Get().GlobalTuning.EntriesByName["lotmotives"]; } if (vm.TSOState.PropertyCategory == 4 && type > 0) { rate = (rate * 3) / 2; //1.5x gain multiplier on services lots } if (VMMotive.Comfort == type) { return(rate); } var ind = Array.IndexOf(VMAvatarMotiveDecay.DecrementMotives, type); var cat = vm.TSOState.PropertyCategory; if (cat == 255) { cat = 0; } string category = VMAvatarMotiveDecay.CategoryNames[cat]; var weight = ToFixed1000(LotMotives.Value.GetNum(category + "_" + VMAvatarMotiveDecay.LotMotiveNames[ind] + "Weight")); return((rate * 1000) / weight); } }
public virtual void SetMotiveChange(VMMotive motive, short PerHourChange, short MaxValue) { var temp = MotiveChanges[(int)motive]; temp.PerHourChange = PerHourChange; temp.MaxValue = MaxValue; }
public short GetLimit(VMMotive motive) { if (MotiveOverfill.TryGetValue((int)motive, out var result)) { return((short)result); } return(100); }
public virtual short GetMotiveData(VMMotive variable) //needs special conditions for ones like Mood. { if ((ushort)variable > 15) { throw new Exception("Motive Data out of bounds!"); } return(MotiveData[(ushort)variable]); }
public virtual bool SetMotiveData(VMMotive variable, short value) { if ((ushort)variable > 15) { throw new Exception("Motive Data out of bounds!"); } MotiveData[(ushort)variable] = (short)Math.Max(Math.Min((int)value, 100), -100); return(true); }
public virtual bool SetMotiveData(VMMotive variable, short value) { if ((ushort)variable > 15) { throw new Exception("Motive Data out of bounds!"); } MotiveData[(ushort)variable] = value; return(true); }
public void Read(byte[] bytes) { using (var io = IoBuffer.FromBytes(bytes, ByteOrder.LITTLE_ENDIAN)){ DeltaOwner = (VMVariableScope)io.ReadByte(); MaxOwner = (VMVariableScope)io.ReadByte(); Motive = (VMMotive)io.ReadByte(); Flags = (VMSetMotiveChangeFlags)io.ReadByte(); DeltaData = io.ReadUInt16(); MaxData = io.ReadUInt16(); } }
public virtual short GetMotiveData(VMMotive variable) //needs special conditions for ones like Mood. { switch (variable) { case VMMotive.Mood: return(50); //always happy!! really!! it's not a front :( } if ((ushort)variable > 15) { throw new Exception("Motive Data out of bounds!"); } return(MotiveData[(ushort)variable]); }
public static int ScaleRate(VM vm, int rate, VMMotive type) { if (vm.TSOState.PropertyCategory == 4 && type > 0) { rate = (rate * 3) / 2; //1.5x gain multiplier on services lots } if (VMMotive.Comfort == type) { return(rate); } var ind = Array.IndexOf(VMAvatarMotiveDecay.DecrementMotives, type); string category = VMAvatarMotiveDecay.CategoryNames[vm.TSOState.PropertyCategory]; var weight = ToFixed1000(LotMotives.GetNum(category + "_" + VMAvatarMotiveDecay.LotMotiveNames[ind] + "Weight")); return((rate * 1000) / weight); }
public virtual bool SetMotiveData(VMMotive variable, short value) { if ((ushort)variable > 15) throw new Exception("Motive Data out of bounds!"); MotiveData[(ushort)variable] = value; return true; }
public bool HasMotiveChange(VMMotive motive) { return(MotiveChanges[(int)motive].PerHourChange != 0); }
public virtual bool SetMotiveData(VMMotive variable, short value) { if ((ushort)variable > 15) throw new Exception("Motive Data out of bounds!"); MotiveData[(ushort)variable] = (short)Math.Max(Math.Min((int)value, 100), -100); return true; }
//needs special conditions for ones like Mood. public virtual short GetMotiveData(VMMotive variable) { switch (variable){ case VMMotive.Mood: return 50; //always happy!! really!! it's not a front :( } if ((ushort)variable > 15) throw new Exception("Motive Data out of bounds!"); return MotiveData[(ushort)variable]; }
public static short ScaleMax(VM vm, short oldMax, VMMotive type) { return((short)((oldMax - 100) + vm.TuningCache.GetLimit(type))); }
//needs special conditions for ones like Mood. public virtual short GetMotiveData(VMMotive variable) { if ((ushort)variable > 15) throw new Exception("Motive Data out of bounds!"); return MotiveData[(ushort)variable]; }