cityrp.weed
Weed growing: client bootstrap + market sync.
- Sharedcityrp.weed.ApplyWetInventoryRot(quality, harvestedAt) → number, numberSource ☍
-
Applies inventory rot to a wet-bud quality given when it was harvested. Same shape as overripe plant bleed: grace window, then points lost per minute.
Parameters
- qualitynumberBase quality 0-100.
- harvestedAtnumber?Unix timestamp from wet_bud meta.
Returns
- 1numberRot-adjusted quality.
- 2numberPoints lost to rot (0 if still in grace).
- Sharedcityrp.weed.CanPotGrow(pot) → boolean, (string|Entity)?Source ☍
-
Returns whether a pot is allowed to grow at its current position.
Parameters
- potEntity
Returns
- 1boolean
- 2(string|Entity)?
- Servercityrp.weed.ConsumeBaggedForCook(ply, amount) → boolean, number?, string?Source ☍
-
Consumes bagged weed for cooking, worst-quality first. Returns weighted average quality and majority strain among units taken (ties broken by first stack encountered).
Parameters
- plyPlayer
- amountnumberUnits to remove.
Returns
- 1boolean
- 2number?Averaged quality (nil if failed).
- 3string?Majority strain id.
- Sharedcityrp.weed.CountPotsInTent(tent) → numberSource ☍
-
Counts weed pots currently within radius of a tent.
Parameters
- tentEntity
Returns
- number
- Servercityrp.weed.DetachTentMounts(tent)Source ☍
-
Releases parented pot/UV from a tent without deleting them (e.g. tent destroyed).
Parameters
- tentEntity
- Servercityrp.weed.DumpMarketToChat(ply)Source ☍
-
Dumps today's rolled weed market to the caller's chat (beta debug helper).
Parameters
- plyPlayer
- Sharedcityrp.weed.FindNearestTent(pot) → Entity?Source ☍
-
Finds the nearest grow tent within TentRadius of the pot (nil if none). Prefers an active weld mount over distance.
Parameters
- potEntity
Returns
- Sharedcityrp.weed.FormatDemandMult(mult) → stringSource ☍
-
Formats a demand multiplier for UI (e.g. "1.10× (+10%)").
Parameters
- multnumber
Returns
- string
- Sharedcityrp.weed.GetBaseUnitPrice(quality) → numberSource ☍
-
Quality-only unit price (no strain demand) — what Stormzy calls the "usual cut".
Parameters
- qualitynumber?Quality 0-100.
Returns
- number
- Sharedcityrp.weed.GetBrowniePrice(quality, strainId) → numberSource ☍
-
Stormzy unit price for one pot brownie (quality + strain demand, premium over bagged weed). Uses the same demand curve as bagged weed. Legacy (no quality) prices as ~40% quality.
Parameters
- qualitynumber?Quality 0-100.
- strainIdstring?Strain id.
Returns
- number
- Sharedcityrp.weed.GetDemandMultiplier(strainId) → numberSource ☍
-
Parameters
- strainIdstring?
Returns
- number
- Sharedcityrp.weed.GetDemandPitch(plyName) → stringSource ☍
-
In-character blurb about hidden daily demand (no strain names).
Parameters
- plyNamestring?
Returns
- string
- Servercityrp.weed.GetLawDestroyer(dmg) → Player?Source ☍
-
Resolves the law-enforcement player who dealt the killing damage (ram FireBullets path).
Parameters
Returns
- Sharedcityrp.weed.GetLocalBaggedBatches() → table[]Source ☍
-
Client-side: lists bagged weed batches with quality, strain and price breakdown for the sell UI.
Returns
- table[]{ metaKey, amount, quality, strain, basePrice, demandMult?, unitPrice?, demandKnown, hot }
- Sharedcityrp.weed.GetLocalBaggedTotal() → numberSource ☍
-
Client-side: sums bagged weed across every meta stack in the local inventory mirror.
Returns
- number
- Sharedcityrp.weed.GetLocalBrownieBatches() → table[]Source ☍
-
Client-side: lists pot brownie batches with quality, strain and price breakdown for the sell UI.
Returns
- table[]{ metaKey, amount, quality, strain, basePrice, demandMult?, unitPrice?, demandKnown, hot }
- Sharedcityrp.weed.GetLocalBrownieTotal() → numberSource ☍
-
Client-side: sums pot brownies across every meta stack in the local inventory mirror.
Returns
- number
- Sharedcityrp.weed.GetMoistureBand() → number, numberSource ☍
-
Today's ideal moisture band (server roll). Clients never receive this.
Returns
- 1number
- 2number
- Sharedcityrp.weed.GetPlantStartMoisture() → numberSource ☍
-
Moisture a newly planted pot starts at: the top of today's ideal band. A fixed 55 started floor-band days above the HQ window after the grace expired.
Returns
- number
- Sharedcityrp.weed.GetPotTent(pot) → boolean, Entity?Source ☍
-
Returns the tent a pot is currently near (live distance check).
Parameters
- potEntity
Returns
- 1boolean
- 2Entity?
- Sharedcityrp.weed.GetSeedItemID(strainId) → stringSource ☍
-
Parameters
- strainIdstring?
Returns
- string
- Sharedcityrp.weed.GetStrainByIndex(index) → stringSource ☍
-
Parameters
- indexnumber
Returns
- string
- Sharedcityrp.weed.GetStrainIndex(strainId) → numberSource ☍
-
@return — 1-based index into StrainOrder
Parameters
- strainIdstring?
Returns
- number1-based index into StrainOrder
- Sharedcityrp.weed.GetStrainName(strainId) → stringSource ☍
-
Parameters
- strainIdstring?
Returns
- string
- Sharedcityrp.weed.GetTotalBagged(ply) → numberSource ☍
-
Sums bagged weed across every meta stack (GetInvAmount without meta only sees "0").
Parameters
- plyPlayer
Returns
- number
- Sharedcityrp.weed.GetTotalBrownies(ply) → numberSource ☍
-
Sums pot brownies across every meta stack.
Parameters
- plyPlayer
Returns
- number
- Sharedcityrp.weed.GetUnitPrice(quality, strainId) → numberSource ☍
-
Stormzy unit price for bagged weed (quality² base × today's strain demand).
Parameters
- qualitynumber?Quality 0-100.
- strainIdstring?Strain id.
Returns
- number
- Sharedcityrp.weed.IsDemandRevealed(strainId, ply) → booleanSource ☍
-
Whether this client (or the given player, server-side) has unlocked today's demand for a strain.
Parameters
- strainIdstring?
- plyPlayer?Server-only; ignored on client.
Returns
- boolean
- Sharedcityrp.weed.IsGrowEquipmentItem(itemId) → booleanSource ☍
-
True if this inventory id is grow gear / a strain seed (event passivemode, etc.). Does not include bagged weed, buds, baggies, or brownies (those can still be sold/used).
Parameters
- itemIdstring?
Returns
- boolean
- Sharedcityrp.weed.IsHotStrain(strainId) → booleanSource ☍
-
Parameters
- strainIdstring?
Returns
- boolean
- Sharedcityrp.weed.IsPotNearTent(pot, tent) → booleanSource ☍
-
Returns whether a pot is within TentRadius of a tent (or welded into it).
Parameters
Returns
- boolean
- Sharedcityrp.weed.IsValidStrain(strainId) → booleanSource ☍
-
Parameters
- strainIdstring?
Returns
- boolean
- Sharedcityrp.weed.MarkPotInTent(tent, pot)Source ☍
-
Marks a pot as inside a tent (membership cache + networked InTent).
Parameters
- Sharedcityrp.weed.MarkPotLeftTent(tent, pot)Source ☍
-
Clears tent membership when a pot leaves proximity.
Parameters
- Sharedcityrp.weed.NormalizeStrain(strainId) → stringSource ☍
-
Parameters
- strainIdstring?
Returns
- string
- Sharedcityrp.weed.Notify(ply, key, msg, ntype, cooldown) → booleanSource ☍
-
Cooldown-gated player notify for weed interactions (stops E-spam).
Parameters
- plyPlayer
- keystringCooldown bucket (e.g. "pot_use").
- msgstring
- ntypenumber?NOTIFY_*
- cooldownnumber?Seconds (default 2).
Returns
- boolean
- Servercityrp.weed.PayLawDestroyBonus(dmg, ent, kind)Source ☍
-
Pays a small destroy bonus to LE for active weed gear (mirrors playerDestroyContraband pay-out).
kind: | "pot" | "rack"Parameters
- dmgCTakeDamageInfo
- entEntity
- kind"pot"|"rack"
- Servercityrp.weed.PickupTentWithMounts(tent, ply) → boolean, string?Source ☍
-
Inventories mounted pot + UV with the tent (validates plant / ownership).
Parameters
Returns
- 1boolean
- 2string?
- Sharedcityrp.weed.PlaceStubOnFloor(ent)Source ☍
-
Lifts a mid-origin stub prop so its bounding box sits on the spawn point instead of in the floor.
Parameters
- entEntity
- Sharedcityrp.weed.PollTentMembership()Source ☍
-
Polls all pots against tent proximity (also covers unwelded pots near a tent).
- Servercityrp.weed.RemountPotAfterModelChange(pot)Source ☍
-
Re-parents a pot after SetModel (physics recreate). Uses stored local pose.
Parameters
- potEntity
- Sharedcityrp.weed.ResyncPotTent(pot)Source ☍
-
Syncs one pot's tent membership from mount / distance (used by the 1s poll and drops).
Parameters
- potEntity
- Servercityrp.weed.RevealDemand(ply, strainId) → booleanSource ☍
-
Marks a strain's demand as known for this player today and resyncs their client market. Persists across reconnect (SteamID table); cleared on RollMarket / map change.
Parameters
- plyPlayer
- strainIdstring?
Returns
- boolean
- Servercityrp.weed.RollMarket()Source ☍
-
Rolls today's hot strain, hidden demand multipliers, and moisture ideal band. One hot strain at HotStrainMultiplier, one soft strain at DemandMultMin, the rest 1×. Mirrors meth: once per map/plugin load (not calendar day, not in-game day).
- Servercityrp.weed.SyncMarket(ply)Source ☍
-
Sends per-player revealed demand multipliers only (0 = still unknown). Moisture band and unrevealed mults stay server-only.
Parameters
- plyPlayer?
- Servercityrp.weed.TryMountPot(tent, pot) → booleanSource ☍
-
Tries to mount a pot into the tent floor (one pot per tent).
Parameters
Returns
- boolean
- Servercityrp.weed.TryMountUV(tent, light) → booleanSource ☍
-
Tries to mount a UV light onto the tent ceiling (one light per tent).
Parameters
Returns
- boolean
- Servercityrp.weed.TryPlantSeed(pot, seed) → booleanSource ☍
-
Attempts to plant a seed entity into a mounted plantable pot. Used when pot Touch is unavailable (SetParent children often skip world collision).
Parameters
Returns
- boolean
- Sharedcityrp.weed.ConfigSource ☍
-
Tunables for the weed grow / process / sell loop.
- Clientcityrp.weed.MarketSource ☍
- Sharedcityrp.weed.StrainOrderSource ☍
-
Ordered strain ids for stable iteration / net sync.
- Sharedcityrp.weed.StrainsSource ☍
-
Strain catalogue (stable ids for items / meta / market rolls).
- Sharedcityrp.weed.ConfigSource ☍
-
Tunables for the weed grow / process / sell loop.
- Sharedcityrp.weed.DemandRevealedSource ☍
-
SteamID → { [strainId] = true }. Cleared on RollMarket (map/plugin load).