- Group First: Before anything else, group related items from the raw change list into a single, high-level feature. For example,
added popup on actor hoverandadded popup bgsbecome one item:a popup with actor info.- Use colon and list for details: When a feature has multiple specific implementations, list those to preserve granular information. For example:
- навыки для ящеров: травят оружие ядом, последний получает эффект Last Stand - огромный рефакторинг системы навыков: контейнер, умный базовый класс, много фиксов
- Don't over-consolidate: The goal is clarity, not minimalism. Preserve important details within grouped items.
- Use colon and list for details: When a feature has multiple specific implementations, list those to preserve granular information. For example:
- Group First: Before anything else, group related items from the raw change list into a single, high-level feature. For example,
added popup on actor hoverandadded popup bgsbecome one item:a popup with actor info.- Use colon and list for details: When a feature has multiple specific implementations, use list those to preserve granular information. For example:
- навыки для ящеров: травят оружие ядом, последний получает эффект Last Stand - огромный рефакторинг системы навыков: контейнер, умный базовый класс, много фиксов
- Don't over-consolidate: The goal is clarity, not minimalism. Preserve important details within grouped items.
- Use colon and list for details: When a feature has multiple specific implementations, use list those to preserve granular information. For example:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local index, index2item; | |
| mod.hook("scripts/states/world_state", function (q) { | |
| q.onBeforeSerialize = @(__original) function (_out) { | |
| index = 0; | |
| __original(_out); | |
| } | |
| q.onBeforeDeserialize = @(__original) function (_in) { | |
| index = 0; | |
| index2item = {} | |
| __original(_in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local rosetta = { | |
| mod = "mod_necro" | |
| // source_lang = "en" | |
| lang = "ru" | |
| version = "0.3.0" | |
| // minVersion = "0.2.1" | |
| } | |
| local function green(text) { | |
| return ::Const.UI.getColorized(text + "", ::Const.UI.Color.PositiveValue) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| class AbstractToken: | |
| async def wait(self, is_async=True): # A placeholder for the real thing | |
| await asyncio.sleep(0.2) | |
| return | |
| async def wrap(self, task): | |
| future = asyncio.ensure_future(task) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Cycle bros | |
| local bros = World.getPlayerRoster().getAll(); | |
| foreach (bro in bros) { | |
| logInfo(bro.getName()); | |
| // ... | |
| } | |
| // Add skill to a bro | |
| local bro = ::getBro("Hubert") | |
| local trait = this.new("scripts/skills/traits/master_trait"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Cook and Blacksmith fix | |
| ::mods_queue(hx.ID, null, function () { | |
| logInfo("load hitpoints debug and fix"); | |
| local inAssetManagerUpdate = false; | |
| local gen = ::rng_new(); | |
| ::mods_hookNewObjectOnce("states/world/asset_manager", function (o) { | |
| this.logInfo("hx: hook asset_manager"); | |
| local update = o.update; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Script Error | |
| the index 'getID' does not exist | |
| Function: | |
| onUse -> scripts/skills/actives/cascade_skill.nut : 90 | |
| Variables: | |
| ret = True, target = Table, _targetTile = Instance, _user = Instance, this = Table | |
| Function: | |
| -> msu/hooks/skills/skill.nut : 334 | |
| Variables: | |
| use = Function, targetEntity = Table, container = Instance, _forFree = True, _targetTile = Instance, this = Table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ::mods_hookExactClass("ai/tactical/behaviors/ai_engage_ranged", function (o) { | |
| local function isRelevant(_actor) { | |
| return !_actor.isNull() && !_actor.m.IsDying && _actor.m.IsAlive; | |
| } | |
| local function cleanup(_b) { | |
| _b.m.ValidTargets = _b.m.ValidTargets.filter(@(_, t) isRelevant(t.Actor)); | |
| _b.m.PotentialDanger = _b.m.PotentialDanger.filter(@(_, a) isRelevant(a)); | |
| } |
> Write a blog post about this code trick:
import logging
import os
from funcy import monkey
from django.db.models.query_utils import DeferredAttributeNewerOlder