mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Corporations II: Adds corporate discounts to the traitor uplink (#10197)
* Adds corporate discounts to the traitor uplink * Actually adds the manufacturing
This commit is contained in:
@@ -182,8 +182,9 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
continue
|
||||
cat["items"] += list(list(
|
||||
"name" = I.name,
|
||||
"cost" = I.cost,
|
||||
"cost" = I.manufacturer && user.mind.is_employee(I.manufacturer) ? CEILING(I.cost * 0.8, 1) : I.cost,
|
||||
"desc" = I.desc,
|
||||
"manufacturer" = I.manufacturer ? initial(I.manufacturer.name) : null,
|
||||
))
|
||||
data["categories"] += list(cat)
|
||||
return data
|
||||
@@ -219,10 +220,14 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
return
|
||||
if (!user || user.incapacitated())
|
||||
return
|
||||
|
||||
if(telecrystals < U.cost || U.limited_stock == 0)
|
||||
return
|
||||
telecrystals -= U.cost
|
||||
if(U.manufacturer && user.mind.is_employee(U.manufacturer))
|
||||
if(telecrystals < CEILING(U.cost*0.8, 1) || U.limited_stock == 0)
|
||||
return
|
||||
telecrystals -= CEILING(U.cost*0.8, 1)
|
||||
else
|
||||
if(telecrystals < U.cost || U.limited_stock == 0)
|
||||
return
|
||||
telecrystals -= U.cost
|
||||
|
||||
U.purchase(user, src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user