13 Debug.Log(
string.Concat(
new string[]
20 item.price.ToString(),
22 (item.num * item.price).ToString()
27 Debug.Log(
string.Concat(
new string[]
34 item2.price.ToString(),
36 (item2.num * item2.price).ToString()
42 public bool HasBought(
Thing t)
46 while (enumerator.MoveNext())
48 if (enumerator.Current.thing == t)
58 public bool CanSellBack(
Thing t,
int num = -1)
66 if (item.thing == t && item.num >= num)
75 public void Process(
Thing t,
int n,
bool sell)
77 int price = t.GetPrice(this.trader.currency,
false,
this.trader.priceType,
null);
78 int price2 = t.GetPrice(this.trader.currency,
true,
this.trader.priceType,
null);
80 Debug.Log(
string.Concat(
new string[]
82 sell ?
"■Selling:" :
"■Buying:",
87 (sell ? price2 : price).ToString(),
89 (n * (sell ? price2 : price)).ToString()
91 int num2 = sell ? price : price2;
95 if (item.thing.id == t.id && item.price == num2)
97 int num3 = (item.num >= num) ? num : item.num;
138 public int GetPrice(
Thing t,
int n,
bool sell)
140 int price = t.GetPrice(this.trader.currency,
false,
this.trader.priceType,
null);
141 int price2 = t.GetPrice(this.trader.currency,
true,
this.trader.priceType,
null);
144 int num3 = sell ? price : price2;
147 if (item.thing.id == t.id && item.price == num3)
149 int num4 = (item.num >= num) ? num : item.num;
158 return num2 + num * (sell ? price2 : price);
162 public void OnEndTransaction()
166 Debug.Log(item.thing);
167 item.thing.SetInt(101, 0);
168 item.thing.isStolen =
false;
170 if (this.trader.currency != CurrencyType.Money)
172 ShopTransaction.current =
null;
178 for (
int i = 0; i < item2.num; i++)
180 num += (int)Mathf.Sqrt((
float)Mathf.Abs(item2.price * 2));
184 EClass.player.flags.landDeedBought += item2.num;
189 EClass.pc.ModExp(291, num);
191 Debug.Log(
"negotiation total:" + num.ToString());
195 if (item3.thing.isStolen)
197 item3.thing.isStolen =
false;
198 for (
int j = 0; j < item3.num; j++)
200 num += (int)Mathf.Sqrt((
float)item3.price) / 2;
204 Debug.Log(
"stolen total:" + num.ToString());
207 Guild.Thief.AddContribution(num);
209 ShopTransaction.current =
null;